3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_24"
13 #define CYTHON_HEX_VERSION 0x001D18F0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #elif defined(PYSTON_VERSION)
89 #define CYTHON_COMPILING_IN_PYPY 0
90 #define CYTHON_COMPILING_IN_PYSTON 1
91 #define CYTHON_COMPILING_IN_CPYTHON 0
92 #ifndef CYTHON_USE_TYPE_SLOTS
93 #define CYTHON_USE_TYPE_SLOTS 1
95 #undef CYTHON_USE_PYTYPE_LOOKUP
96 #define CYTHON_USE_PYTYPE_LOOKUP 0
97 #undef CYTHON_USE_ASYNC_SLOTS
98 #define CYTHON_USE_ASYNC_SLOTS 0
99 #undef CYTHON_USE_PYLIST_INTERNALS
100 #define CYTHON_USE_PYLIST_INTERNALS 0
101 #ifndef CYTHON_USE_UNICODE_INTERNALS
102 #define CYTHON_USE_UNICODE_INTERNALS 1
104 #undef CYTHON_USE_UNICODE_WRITER
105 #define CYTHON_USE_UNICODE_WRITER 0
106 #undef CYTHON_USE_PYLONG_INTERNALS
107 #define CYTHON_USE_PYLONG_INTERNALS 0
108 #ifndef CYTHON_AVOID_BORROWED_REFS
109 #define CYTHON_AVOID_BORROWED_REFS 0
111 #ifndef CYTHON_ASSUME_SAFE_MACROS
112 #define CYTHON_ASSUME_SAFE_MACROS 1
114 #ifndef CYTHON_UNPACK_METHODS
115 #define CYTHON_UNPACK_METHODS 1
117 #undef CYTHON_FAST_THREAD_STATE
118 #define CYTHON_FAST_THREAD_STATE 0
119 #undef CYTHON_FAST_PYCALL
120 #define CYTHON_FAST_PYCALL 0
121 #undef CYTHON_PEP489_MULTI_PHASE_INIT
122 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
123 #undef CYTHON_USE_TP_FINALIZE
124 #define CYTHON_USE_TP_FINALIZE 0
125 #undef CYTHON_USE_DICT_VERSIONS
126 #define CYTHON_USE_DICT_VERSIONS 0
127 #undef CYTHON_USE_EXC_INFO_STACK
128 #define CYTHON_USE_EXC_INFO_STACK 0
130 #define CYTHON_COMPILING_IN_PYPY 0
131 #define CYTHON_COMPILING_IN_PYSTON 0
132 #define CYTHON_COMPILING_IN_CPYTHON 1
133 #ifndef CYTHON_USE_TYPE_SLOTS
134 #define CYTHON_USE_TYPE_SLOTS 1
136 #if PY_VERSION_HEX < 0x02070000
137 #undef CYTHON_USE_PYTYPE_LOOKUP
138 #define CYTHON_USE_PYTYPE_LOOKUP 0
139 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
140 #define CYTHON_USE_PYTYPE_LOOKUP 1
142 #if PY_MAJOR_VERSION < 3
143 #undef CYTHON_USE_ASYNC_SLOTS
144 #define CYTHON_USE_ASYNC_SLOTS 0
145 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
146 #define CYTHON_USE_ASYNC_SLOTS 1
148 #if PY_VERSION_HEX < 0x02070000
149 #undef CYTHON_USE_PYLONG_INTERNALS
150 #define CYTHON_USE_PYLONG_INTERNALS 0
151 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
152 #define CYTHON_USE_PYLONG_INTERNALS 1
154 #ifndef CYTHON_USE_PYLIST_INTERNALS
155 #define CYTHON_USE_PYLIST_INTERNALS 1
157 #ifndef CYTHON_USE_UNICODE_INTERNALS
158 #define CYTHON_USE_UNICODE_INTERNALS 1
160 #if PY_VERSION_HEX < 0x030300F0
161 #undef CYTHON_USE_UNICODE_WRITER
162 #define CYTHON_USE_UNICODE_WRITER 0
163 #elif !defined(CYTHON_USE_UNICODE_WRITER)
164 #define CYTHON_USE_UNICODE_WRITER 1
166 #ifndef CYTHON_AVOID_BORROWED_REFS
167 #define CYTHON_AVOID_BORROWED_REFS 0
169 #ifndef CYTHON_ASSUME_SAFE_MACROS
170 #define CYTHON_ASSUME_SAFE_MACROS 1
172 #ifndef CYTHON_UNPACK_METHODS
173 #define CYTHON_UNPACK_METHODS 1
175 #ifndef CYTHON_FAST_THREAD_STATE
176 #define CYTHON_FAST_THREAD_STATE 1
178 #ifndef CYTHON_FAST_PYCALL
179 #define CYTHON_FAST_PYCALL 1
181 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
182 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
184 #ifndef CYTHON_USE_TP_FINALIZE
185 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
187 #ifndef CYTHON_USE_DICT_VERSIONS
188 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
190 #ifndef CYTHON_USE_EXC_INFO_STACK
191 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
194 #if !defined(CYTHON_FAST_PYCCALL)
195 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
197 #if CYTHON_USE_PYLONG_INTERNALS
198 #include "longintrepr.h"
203 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
206 #ifndef __has_attribute
207 #define __has_attribute(x) 0
209 #ifndef __has_cpp_attribute
210 #define __has_cpp_attribute(x) 0
212 #ifndef CYTHON_RESTRICT
213 #if defined(__GNUC__)
214 #define CYTHON_RESTRICT __restrict__
215 #elif defined(_MSC_VER) && _MSC_VER >= 1400
216 #define CYTHON_RESTRICT __restrict
217 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218 #define CYTHON_RESTRICT restrict
220 #define CYTHON_RESTRICT
223 #ifndef CYTHON_UNUSED
224 # if defined(__GNUC__)
225 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
226 # define CYTHON_UNUSED __attribute__ ((__unused__))
228 # define CYTHON_UNUSED
230 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
231 # define CYTHON_UNUSED __attribute__ ((__unused__))
233 # define CYTHON_UNUSED
236 #ifndef CYTHON_MAYBE_UNUSED_VAR
237 # if defined(__cplusplus)
238 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
240 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
243 #ifndef CYTHON_NCP_UNUSED
244 # if CYTHON_COMPILING_IN_CPYTHON
245 # define CYTHON_NCP_UNUSED
247 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
250 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
252 #ifndef _MSC_STDINT_H_
254 typedef unsigned char uint8_t;
255 typedef unsigned int uint32_t;
257 typedef unsigned __int8 uint8_t;
258 typedef unsigned __int32 uint32_t;
264 #ifndef CYTHON_FALLTHROUGH
265 #if defined(__cplusplus) && __cplusplus >= 201103L
266 #if __has_cpp_attribute(fallthrough)
267 #define CYTHON_FALLTHROUGH [[fallthrough]]
268 #elif __has_cpp_attribute(clang::fallthrough)
269 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
270 #elif __has_cpp_attribute(gnu::fallthrough)
271 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
274 #ifndef CYTHON_FALLTHROUGH
275 #if __has_attribute(fallthrough)
276 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
278 #define CYTHON_FALLTHROUGH
281 #if defined(__clang__ ) && defined(__apple_build_version__)
282 #if __apple_build_version__ < 7000000
283 #undef CYTHON_FALLTHROUGH
284 #define CYTHON_FALLTHROUGH
289 #ifndef CYTHON_INLINE
290 #if defined(__clang__)
291 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
292 #elif defined(__GNUC__)
293 #define CYTHON_INLINE __inline__
294 #elif defined(_MSC_VER)
295 #define CYTHON_INLINE __inline
296 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
297 #define CYTHON_INLINE inline
299 #define CYTHON_INLINE
303 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
304 #define Py_OptimizeFlag 0
306 #define __PYX_BUILD_PY_SSIZE_T "n"
307 #define CYTHON_FORMAT_SSIZE_T "z"
308 #if PY_MAJOR_VERSION < 3
309 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
310 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
311 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
312 #define __Pyx_DefaultClassType PyClass_Type
314 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
315 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
316 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
317 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
319 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
320 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
322 #define __Pyx_DefaultClassType PyType_Type
324 #ifndef Py_TPFLAGS_CHECKTYPES
325 #define Py_TPFLAGS_CHECKTYPES 0
327 #ifndef Py_TPFLAGS_HAVE_INDEX
328 #define Py_TPFLAGS_HAVE_INDEX 0
330 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
331 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
333 #ifndef Py_TPFLAGS_HAVE_FINALIZE
334 #define Py_TPFLAGS_HAVE_FINALIZE 0
336 #ifndef METH_STACKLESS
337 #define METH_STACKLESS 0
339 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
340 #ifndef METH_FASTCALL
341 #define METH_FASTCALL 0x80
343 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
344 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
345 Py_ssize_t nargs, PyObject *kwnames);
347 #define __Pyx_PyCFunctionFast _PyCFunctionFast
348 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
350 #if CYTHON_FAST_PYCCALL
351 #define __Pyx_PyFastCFunction_Check(func)\
352 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
354 #define __Pyx_PyFastCFunction_Check(func) 0
356 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
357 #define PyObject_Malloc(s) PyMem_Malloc(s)
358 #define PyObject_Free(p) PyMem_Free(p)
359 #define PyObject_Realloc(p) PyMem_Realloc(p)
361 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
362 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
363 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
364 #define PyMem_RawFree(p) PyMem_Free(p)
366 #if CYTHON_COMPILING_IN_PYSTON
367 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
368 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
370 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
371 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
373 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
374 #define __Pyx_PyThreadState_Current PyThreadState_GET()
375 #elif PY_VERSION_HEX >= 0x03060000
376 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
377 #elif PY_VERSION_HEX >= 0x03000000
378 #define __Pyx_PyThreadState_Current PyThreadState_GET()
380 #define __Pyx_PyThreadState_Current _PyThreadState_Current
382 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
383 #include "pythread.h"
384 #define Py_tss_NEEDS_INIT 0
385 typedef int Py_tss_t;
386 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
387 *key = PyThread_create_key();
390 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
391 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
392 *key = Py_tss_NEEDS_INIT;
395 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
398 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
399 return *key != Py_tss_NEEDS_INIT;
401 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
402 PyThread_delete_key(*key);
403 *key = Py_tss_NEEDS_INIT;
405 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
406 return PyThread_set_key_value(*key, value);
408 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
409 return PyThread_get_key_value(*key);
412 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
413 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
415 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
417 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
418 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
419 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
421 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
422 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
424 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
425 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
427 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
429 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
430 #define CYTHON_PEP393_ENABLED 1
431 #if defined(PyUnicode_IS_READY)
432 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
433 0 : _PyUnicode_Ready((PyObject *)(op)))
435 #define __Pyx_PyUnicode_READY(op) (0)
437 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
438 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
439 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
440 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
441 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
442 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
443 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
444 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
445 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
446 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
448 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
451 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
454 #define CYTHON_PEP393_ENABLED 0
455 #define PyUnicode_1BYTE_KIND 1
456 #define PyUnicode_2BYTE_KIND 2
457 #define PyUnicode_4BYTE_KIND 4
458 #define __Pyx_PyUnicode_READY(op) (0)
459 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
460 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
461 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
462 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
463 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
464 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
465 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
466 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
468 #if CYTHON_COMPILING_IN_PYPY
469 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
470 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
472 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
473 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
474 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
476 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
477 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
479 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
480 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
482 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
483 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
485 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
486 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
487 #if PY_MAJOR_VERSION >= 3
488 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
490 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
492 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
493 #define PyObject_ASCII(o) PyObject_Repr(o)
495 #if PY_MAJOR_VERSION >= 3
496 #define PyBaseString_Type PyUnicode_Type
497 #define PyStringObject PyUnicodeObject
498 #define PyString_Type PyUnicode_Type
499 #define PyString_Check PyUnicode_Check
500 #define PyString_CheckExact PyUnicode_CheckExact
501 #ifndef PyObject_Unicode
502 #define PyObject_Unicode PyObject_Str
505 #if PY_MAJOR_VERSION >= 3
506 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
507 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
509 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
510 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
512 #ifndef PySet_CheckExact
513 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
515 #if PY_VERSION_HEX >= 0x030900A4
516 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
517 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
519 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
520 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
522 #if CYTHON_ASSUME_SAFE_MACROS
523 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
525 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
527 #if PY_MAJOR_VERSION >= 3
528 #define PyIntObject PyLongObject
529 #define PyInt_Type PyLong_Type
530 #define PyInt_Check(op) PyLong_Check(op)
531 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
532 #define PyInt_FromString PyLong_FromString
533 #define PyInt_FromUnicode PyLong_FromUnicode
534 #define PyInt_FromLong PyLong_FromLong
535 #define PyInt_FromSize_t PyLong_FromSize_t
536 #define PyInt_FromSsize_t PyLong_FromSsize_t
537 #define PyInt_AsLong PyLong_AsLong
538 #define PyInt_AS_LONG PyLong_AS_LONG
539 #define PyInt_AsSsize_t PyLong_AsSsize_t
540 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
541 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
542 #define PyNumber_Int PyNumber_Long
544 #if PY_MAJOR_VERSION >= 3
545 #define PyBoolObject PyLongObject
547 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
548 #ifndef PyUnicode_InternFromString
549 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
552 #if PY_VERSION_HEX < 0x030200A4
553 typedef long Py_hash_t;
554 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
555 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
557 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
558 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
560 #if PY_MAJOR_VERSION >= 3
561 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
563 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
565 #if CYTHON_USE_ASYNC_SLOTS
566 #if PY_VERSION_HEX >= 0x030500B1
567 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
568 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
570 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
573 #define __Pyx_PyType_AsAsync(obj) NULL
575 #ifndef __Pyx_PyAsyncMethodsStruct
580 } __Pyx_PyAsyncMethodsStruct;
583 #if defined(WIN32) || defined(MS_WINDOWS)
584 #define _USE_MATH_DEFINES
588 #define __PYX_NAN() ((float) NAN)
590 static CYTHON_INLINE
float __PYX_NAN() {
592 memset(&value, 0xFF,
sizeof(value));
596 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
597 #define __Pyx_truncl trunc
599 #define __Pyx_truncl truncl
602 #define __PYX_MARK_ERR_POS(f_index, lineno) \
603 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
604 #define __PYX_ERR(f_index, lineno, Ln_error) \
605 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
607 #ifndef __PYX_EXTERN_C
609 #define __PYX_EXTERN_C extern "C"
611 #define __PYX_EXTERN_C extern
615 #define __PYX_HAVE__subsurfaceTransportFunctions
616 #define __PYX_HAVE_API__subsurfaceTransportFunctions
620 #include "numpy/arrayobject.h"
621 #include "numpy/ndarrayobject.h"
622 #include "numpy/ndarraytypes.h"
623 #include "numpy/arrayscalars.h"
624 #include "numpy/ufuncobject.h"
633 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
634 #define CYTHON_WITHOUT_ASSERTIONS
637 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
638 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
640 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
641 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
642 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
643 #define __PYX_DEFAULT_STRING_ENCODING ""
644 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
645 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
646 #define __Pyx_uchar_cast(c) ((unsigned char)c)
647 #define __Pyx_long_cast(x) ((long)x)
648 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
649 (sizeof(type) < sizeof(Py_ssize_t)) ||\
650 (sizeof(type) > sizeof(Py_ssize_t) &&\
651 likely(v < (type)PY_SSIZE_T_MAX ||\
652 v == (type)PY_SSIZE_T_MAX) &&\
653 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
654 v == (type)PY_SSIZE_T_MIN))) ||\
655 (sizeof(type) == sizeof(Py_ssize_t) &&\
656 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
657 v == (type)PY_SSIZE_T_MAX))) )
658 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
659 return (
size_t) i < (size_t) limit;
661 #if defined (__cplusplus) && __cplusplus >= 201103L
663 #define __Pyx_sst_abs(value) std::abs(value)
664 #elif SIZEOF_INT >= SIZEOF_SIZE_T
665 #define __Pyx_sst_abs(value) abs(value)
666 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
667 #define __Pyx_sst_abs(value) labs(value)
668 #elif defined (_MSC_VER)
669 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
670 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
671 #define __Pyx_sst_abs(value) llabs(value)
672 #elif defined (__GNUC__)
673 #define __Pyx_sst_abs(value) __builtin_llabs(value)
675 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
677 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
678 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
679 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
680 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
681 #define __Pyx_PyBytes_FromString PyBytes_FromString
682 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
683 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
684 #if PY_MAJOR_VERSION < 3
685 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
686 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
688 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
689 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
691 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
692 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
693 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
694 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
698 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
699 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
700 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
701 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
702 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
703 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
704 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
705 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
706 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
707 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
708 const Py_UNICODE *u_end =
u;
710 return (
size_t)(u_end -
u - 1);
712 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
713 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
714 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
715 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
716 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
717 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
718 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
719 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
720 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
721 #define __Pyx_PySequence_Tuple(obj)\
722 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
723 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
724 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
725 #if CYTHON_ASSUME_SAFE_MACROS
726 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
728 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
730 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
731 #if PY_MAJOR_VERSION >= 3
732 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
734 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
736 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
737 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
738 static int __Pyx_sys_getdefaultencoding_not_ascii;
739 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
741 PyObject* default_encoding = NULL;
742 PyObject* ascii_chars_u = NULL;
743 PyObject* ascii_chars_b = NULL;
744 const char* default_encoding_c;
745 sys = PyImport_ImportModule(
"sys");
747 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
749 if (!default_encoding)
goto bad;
750 default_encoding_c = PyBytes_AsString(default_encoding);
751 if (!default_encoding_c)
goto bad;
752 if (strcmp(default_encoding_c,
"ascii") == 0) {
753 __Pyx_sys_getdefaultencoding_not_ascii = 0;
755 char ascii_chars[128];
757 for (
c = 0;
c < 128;
c++) {
760 __Pyx_sys_getdefaultencoding_not_ascii = 1;
761 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
762 if (!ascii_chars_u)
goto bad;
763 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
764 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
767 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
771 Py_DECREF(ascii_chars_u);
772 Py_DECREF(ascii_chars_b);
774 Py_DECREF(default_encoding);
777 Py_XDECREF(default_encoding);
778 Py_XDECREF(ascii_chars_u);
779 Py_XDECREF(ascii_chars_b);
783 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
784 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
786 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
787 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
788 static char* __PYX_DEFAULT_STRING_ENCODING;
789 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
791 PyObject* default_encoding = NULL;
792 char* default_encoding_c;
793 sys = PyImport_ImportModule(
"sys");
795 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
797 if (!default_encoding)
goto bad;
798 default_encoding_c = PyBytes_AsString(default_encoding);
799 if (!default_encoding_c)
goto bad;
800 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
801 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
802 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
803 Py_DECREF(default_encoding);
806 Py_XDECREF(default_encoding);
814 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
815 #define likely(x) __builtin_expect(!!(x), 1)
816 #define unlikely(x) __builtin_expect(!!(x), 0)
818 #define likely(x) (x)
819 #define unlikely(x) (x)
821 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
823 static PyObject *__pyx_m = NULL;
824 static PyObject *__pyx_d;
825 static PyObject *__pyx_b;
826 static PyObject *__pyx_cython_runtime = NULL;
827 static PyObject *__pyx_empty_tuple;
828 static PyObject *__pyx_empty_bytes;
829 static PyObject *__pyx_empty_unicode;
830 static int __pyx_lineno;
831 static int __pyx_clineno = 0;
832 static const char * __pyx_cfilenm= __FILE__;
833 static const char *__pyx_filename;
836 #if !defined(CYTHON_CCOMPLEX)
837 #if defined(__cplusplus)
838 #define CYTHON_CCOMPLEX 1
839 #elif defined(_Complex_I)
840 #define CYTHON_CCOMPLEX 1
842 #define CYTHON_CCOMPLEX 0
852 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
854 #define _Complex_I 1.0fj
858 static const char *__pyx_f[] = {
859 "proteus/subsurfaceTransportFunctions.pyx",
864 #define IS_UNSIGNED(type) (((type) -1) > 0)
865 struct __Pyx_StructField_;
866 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
869 struct __Pyx_StructField_* fields;
877 typedef struct __Pyx_StructField_ {
878 __Pyx_TypeInfo* type;
883 __Pyx_StructField* field;
884 size_t parent_offset;
885 } __Pyx_BufFmt_StackElem;
887 __Pyx_StructField root;
888 __Pyx_BufFmt_StackElem* head;
890 size_t new_count, enc_count;
891 size_t struct_alignment;
897 } __Pyx_BufFmt_Context;
907 typedef npy_int8 __pyx_t_5numpy_int8_t;
916 typedef npy_int16 __pyx_t_5numpy_int16_t;
925 typedef npy_int32 __pyx_t_5numpy_int32_t;
934 typedef npy_int64 __pyx_t_5numpy_int64_t;
943 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
952 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
961 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
970 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
979 typedef npy_float32 __pyx_t_5numpy_float32_t;
988 typedef npy_float64 __pyx_t_5numpy_float64_t;
997 typedef npy_long __pyx_t_5numpy_int_t;
1006 typedef npy_longlong __pyx_t_5numpy_long_t;
1015 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1024 typedef npy_ulong __pyx_t_5numpy_uint_t;
1033 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1042 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1051 typedef npy_intp __pyx_t_5numpy_intp_t;
1060 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1069 typedef npy_double __pyx_t_5numpy_float_t;
1078 typedef npy_double __pyx_t_5numpy_double_t;
1087 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1096 typedef __pyx_t_5numpy_double_t __pyx_t_28subsurfaceTransportFunctions_DTYPE_t;
1105 typedef int __pyx_t_28subsurfaceTransportFunctions_ITYPE_t;
1109 typedef ::std::complex< float > __pyx_t_float_complex;
1111 typedef float _Complex __pyx_t_float_complex;
1114 typedef struct {
float real, imag; } __pyx_t_float_complex;
1116 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1121 typedef ::std::complex< double > __pyx_t_double_complex;
1123 typedef double _Complex __pyx_t_double_complex;
1126 typedef struct {
double real, imag; } __pyx_t_double_complex;
1128 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1140 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1149 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1158 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1167 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1171 #ifndef CYTHON_REFNANNY
1172 #define CYTHON_REFNANNY 0
1176 void (*INCREF)(
void*, PyObject*, int);
1177 void (*DECREF)(
void*, PyObject*, int);
1178 void (*GOTREF)(
void*, PyObject*, int);
1179 void (*GIVEREF)(
void*, PyObject*, int);
1180 void* (*SetupContext)(
const char*, int,
const char*);
1181 void (*FinishContext)(
void**);
1182 } __Pyx_RefNannyAPIStruct;
1183 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1184 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1185 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1187 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1189 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1190 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1191 PyGILState_Release(__pyx_gilstate_save);\
1193 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1196 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1197 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1199 #define __Pyx_RefNannyFinishContext()\
1200 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1201 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1202 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1203 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1204 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1205 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1206 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1207 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1208 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1210 #define __Pyx_RefNannyDeclarations
1211 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1212 #define __Pyx_RefNannyFinishContext()
1213 #define __Pyx_INCREF(r) Py_INCREF(r)
1214 #define __Pyx_DECREF(r) Py_DECREF(r)
1215 #define __Pyx_GOTREF(r)
1216 #define __Pyx_GIVEREF(r)
1217 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1218 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1219 #define __Pyx_XGOTREF(r)
1220 #define __Pyx_XGIVEREF(r)
1222 #define __Pyx_XDECREF_SET(r, v) do {\
1223 PyObject *tmp = (PyObject *) r;\
1224 r = v; __Pyx_XDECREF(tmp);\
1226 #define __Pyx_DECREF_SET(r, v) do {\
1227 PyObject *tmp = (PyObject *) r;\
1228 r = v; __Pyx_DECREF(tmp);\
1230 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1231 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1234 #if CYTHON_USE_TYPE_SLOTS
1235 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1237 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1241 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1244 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1245 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1248 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1251 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1252 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1253 const char* function_name);
1256 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1257 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1258 __Pyx__ArgTypeTest(obj, type, name, exact))
1259 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1262 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
1265 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
1266 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1267 __Pyx_BufFmt_StackElem* stack,
1268 __Pyx_TypeInfo* type);
1271 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1272 ((obj == Py_None || obj == NULL) ?\
1273 (__Pyx_ZeroBuffer(buf), 0) :\
1274 __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1275 static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1276 __Pyx_TypeInfo* dtype,
int flags,
int nd,
int cast, __Pyx_BufFmt_StackElem* stack);
1277 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1278 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1279 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1280 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1283 static void __Pyx_RaiseBufferIndexError(
int axis);
1285 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
1286 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
1288 #if CYTHON_FAST_THREAD_STATE
1289 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1290 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1291 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1293 #define __Pyx_PyThreadState_declare
1294 #define __Pyx_PyThreadState_assign
1295 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1299 #if CYTHON_FAST_THREAD_STATE
1300 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1301 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1302 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1303 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1304 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1305 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1306 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1307 #if CYTHON_COMPILING_IN_CPYTHON
1308 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1310 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1313 #define __Pyx_PyErr_Clear() PyErr_Clear()
1314 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1315 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1316 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1317 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1318 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1319 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1320 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1324 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1325 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1326 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1327 (likely(PyDict_CheckExact(obj)) ?\
1328 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1330 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1331 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1334 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
1336 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1337 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1338 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1339 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1340 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1341 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1342 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1343 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1344 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1345 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1346 int wraparound,
int boundscheck);
1347 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1348 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1349 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1350 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1351 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1352 int wraparound,
int boundscheck);
1353 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1354 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1355 int is_list,
int wraparound,
int boundscheck);
1358 #if CYTHON_USE_TYPE_SLOTS
1359 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1361 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1365 #if !CYTHON_COMPILING_IN_PYPY
1366 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1368 #define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace, zerodivision_check)\
1369 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1372 #define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3)
1374 #if CYTHON_FAST_PYCALL
1375 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1376 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1377 #if 1 || PY_VERSION_HEX < 0x030600B1
1378 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1380 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1382 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1383 (sizeof(char [1 - 2*!(cond)]) - 1)
1384 #ifndef Py_MEMBER_SIZE
1385 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1387 static size_t __pyx_pyframe_localsplus_offset = 0;
1388 #include "frameobject.h"
1389 #define __Pxy_PyFrame_Initialize_Offsets()\
1390 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1391 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1392 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1393 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1397 #if CYTHON_FAST_PYCCALL
1398 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1400 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1404 #if CYTHON_COMPILING_IN_CPYTHON
1405 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1407 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1411 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1412 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1413 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1414 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1415 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1416 (cache_var) = (value);
1417 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1418 static PY_UINT64_T __pyx_dict_version = 0;\
1419 static PyObject *__pyx_dict_cached_value = NULL;\
1420 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1421 (VAR) = __pyx_dict_cached_value;\
1423 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1424 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1427 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1428 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1429 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1431 #define __PYX_GET_DICT_VERSION(dict) (0)
1432 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1433 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1437 #if CYTHON_USE_DICT_VERSIONS
1438 #define __Pyx_GetModuleGlobalName(var, name) {\
1439 static PY_UINT64_T __pyx_dict_version = 0;\
1440 static PyObject *__pyx_dict_cached_value = NULL;\
1441 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1442 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1443 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1445 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1446 PY_UINT64_T __pyx_dict_version;\
1447 PyObject *__pyx_dict_cached_value;\
1448 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1450 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1452 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1453 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1454 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1458 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1461 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1464 #if CYTHON_COMPILING_IN_CPYTHON
1465 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1469 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1472 static double __Pyx__PyObject_AsDouble(PyObject* obj);
1473 #if CYTHON_COMPILING_IN_PYPY
1474 #define __Pyx_PyObject_AsDouble(obj)\
1475 (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
1476 likely(PyInt_CheckExact(obj)) ?\
1477 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
1479 #define __Pyx_PyObject_AsDouble(obj)\
1480 ((likely(PyFloat_CheckExact(obj))) ?\
1481 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
1485 #if CYTHON_USE_EXC_INFO_STACK
1486 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1490 #if CYTHON_FAST_THREAD_STATE
1491 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1492 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1493 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1494 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1496 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1497 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1501 #if CYTHON_FAST_THREAD_STATE
1502 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1503 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1505 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1509 #if CYTHON_FAST_THREAD_STATE
1510 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1511 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1513 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1517 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1520 #ifndef __PYX_HAVE_RT_ImportType_proto
1521 #define __PYX_HAVE_RT_ImportType_proto
1522 enum __Pyx_ImportType_CheckSize {
1523 __Pyx_ImportType_CheckSize_Error = 0,
1524 __Pyx_ImportType_CheckSize_Warn = 1,
1525 __Pyx_ImportType_CheckSize_Ignore = 2
1527 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1531 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1534 #ifdef CYTHON_CLINE_IN_TRACEBACK
1535 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1537 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1542 PyCodeObject* code_object;
1544 } __Pyx_CodeObjectCacheEntry;
1545 struct __Pyx_CodeObjectCache {
1548 __Pyx_CodeObjectCacheEntry* entries;
1550 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1551 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1552 static PyCodeObject *__pyx_find_code_object(
int code_line);
1553 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1556 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1557 int py_line,
const char *filename);
1561 Py_ssize_t shape, strides, suboffsets;
1562 } __Pyx_Buf_DimInfo;
1568 __Pyx_Buffer *rcbuffer;
1570 __Pyx_Buf_DimInfo diminfo[8];
1571 } __Pyx_LocalBuf_ND;
1573 #if PY_MAJOR_VERSION < 3
1574 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1575 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1577 #define __Pyx_GetBuffer PyObject_GetBuffer
1578 #define __Pyx_ReleaseBuffer PyBuffer_Release
1583 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1584 #define __Pyx_HAS_GCC_DIAGNOSTIC
1590 #define __Pyx_CREAL(z) ((z).real())
1591 #define __Pyx_CIMAG(z) ((z).imag())
1593 #define __Pyx_CREAL(z) (__real__(z))
1594 #define __Pyx_CIMAG(z) (__imag__(z))
1597 #define __Pyx_CREAL(z) ((z).real)
1598 #define __Pyx_CIMAG(z) ((z).imag)
1600 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1601 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1602 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1603 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1605 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1606 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1611 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1612 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1613 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1614 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1615 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1616 #define __Pyx_c_neg_float(a) (-(a))
1618 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1619 #define __Pyx_c_conj_float(z) (::std::conj(z))
1621 #define __Pyx_c_abs_float(z) (::std::abs(z))
1622 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1625 #define __Pyx_c_is_zero_float(z) ((z)==0)
1626 #define __Pyx_c_conj_float(z) (conjf(z))
1628 #define __Pyx_c_abs_float(z) (cabsf(z))
1629 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1633 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1634 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1635 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1636 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1637 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1638 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1639 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1640 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1642 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1643 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1649 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1650 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1651 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1652 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1653 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1654 #define __Pyx_c_neg_double(a) (-(a))
1656 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1657 #define __Pyx_c_conj_double(z) (::std::conj(z))
1659 #define __Pyx_c_abs_double(z) (::std::abs(z))
1660 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1663 #define __Pyx_c_is_zero_double(z) ((z)==0)
1664 #define __Pyx_c_conj_double(z) (conj(z))
1666 #define __Pyx_c_abs_double(z) (cabs(z))
1667 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1671 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1672 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1673 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1674 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1675 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1676 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1677 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1678 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1680 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1681 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1686 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1689 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1692 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
1695 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);
1698 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1701 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1704 #if CYTHON_COMPILING_IN_CPYTHON
1705 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1706 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1707 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1708 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1710 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1711 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1712 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1714 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1717 static int __Pyx_check_binary_version(
void);
1720 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1732 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1745 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1746 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1747 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1748 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1749 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
1750 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
1751 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
1752 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
1753 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
1754 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
1755 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
1756 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
1757 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
1758 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
1759 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1762 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t = {
"ITYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t) ?
'U' :
'I', IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), 0 };
1763 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t = {
"DTYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t), { 0 }, 0,
'R', 0, 0 };
1764 #define __Pyx_MODULE_NAME "subsurfaceTransportFunctions"
1765 extern int __pyx_module_is_main_subsurfaceTransportFunctions;
1766 int __pyx_module_is_main_subsurfaceTransportFunctions = 0;
1769 static PyObject *__pyx_builtin_range;
1770 static PyObject *__pyx_builtin_ImportError;
1771 static const char __pyx_k_I[] =
"I";
1772 static const char __pyx_k_J[] =
"J";
1773 static const char __pyx_k_d[] =
"d";
1774 static const char __pyx_k_i[] =
"i";
1775 static const char __pyx_k_j[] =
"j";
1776 static const char __pyx_k_k[] =
"k";
1777 static const char __pyx_k_m[] =
"m";
1778 static const char __pyx_k_n[] =
"n";
1779 static const char __pyx_k_q[] =
"q";
1780 static const char __pyx_k_t[] =
"t";
1781 static const char __pyx_k_v[] =
"v";
1782 static const char __pyx_k_w[] =
"w";
1783 static const char __pyx_k_x[] =
"x";
1784 static const char __pyx_k_dS[] =
"dS";
1785 static const char __pyx_k_dV[] =
"dV";
1786 static const char __pyx_k_df[] =
"df";
1787 static const char __pyx_k_dm[] =
"dm";
1788 static const char __pyx_k_eN[] =
"eN";
1789 static const char __pyx_k_ii[] =
"ii";
1790 static const char __pyx_k_kb[] =
"kb";
1791 static const char __pyx_k_mt[] =
"mt";
1792 static const char __pyx_k_nd[] =
"nd";
1793 static const char __pyx_k_pi[] =
"pi";
1794 static const char __pyx_k_xc[] =
"xc";
1795 static const char __pyx_k_yc[] =
"yc";
1796 static const char __pyx_k_KWr[] =
"KWr";
1797 static const char __pyx_k_KWs[] =
"KWs";
1798 static const char __pyx_k_dmt[] =
"dmt";
1799 static const char __pyx_k_dot[] =
"dot";
1800 static const char __pyx_k_ebN[] =
"ebN";
1801 static const char __pyx_k_l2g[] =
"l2g";
1802 static const char __pyx_k_nnz[] =
"nnz";
1803 static const char __pyx_k_q_m[] =
"q_m";
1804 static const char __pyx_k_q_r[] =
"q_r";
1805 static const char __pyx_k_q_u[] =
"q_u";
1806 static const char __pyx_k_q_x[] =
"q_x";
1807 static const char __pyx_k_rho[] =
"rho";
1808 static const char __pyx_k_sum[] =
"sum";
1809 static const char __pyx_k_u_j[] =
"u_j";
1810 static const char __pyx_k_vol[] =
"vol";
1811 static const char __pyx_k_a_eN[] =
"a_eN";
1812 static const char __pyx_k_a_up[] =
"a_up";
1813 static const char __pyx_k_beta[] =
"beta";
1814 static const char __pyx_k_ebNE[] =
"ebNE";
1815 static const char __pyx_k_f_up[] =
"f_up";
1816 static const char __pyx_k_flat[] =
"flat";
1817 static const char __pyx_k_flux[] =
"flux";
1818 static const char __pyx_k_main[] =
"__main__";
1819 static const char __pyx_k_name[] =
"__name__";
1820 static const char __pyx_k_one8[] =
"one8";
1821 static const char __pyx_k_psiC[] =
"psiC";
1822 static const char __pyx_k_q_dm[] =
"q_dm";
1823 static const char __pyx_k_q_kr[] =
"q_kr";
1824 static const char __pyx_k_q_mt[] =
"q_mt";
1825 static const char __pyx_k_rho2[] =
"rho2";
1826 static const char __pyx_k_rhom[] =
"rhom";
1827 static const char __pyx_k_sBar[] =
"sBar";
1828 static const char __pyx_k_test[] =
"__test__";
1829 static const char __pyx_k_u_eN[] =
"u_eN";
1830 static const char __pyx_k_vBar[] =
"vBar";
1831 static const char __pyx_k_a_avg[] =
"a_avg";
1832 static const char __pyx_k_alpha[] =
"alpha";
1833 static const char __pyx_k_clock[] =
"clock";
1834 static const char __pyx_k_denom[] =
"denom";
1835 static const char __pyx_k_drhom[] =
"drhom";
1836 static const char __pyx_k_kr_eN[] =
"kr_eN";
1837 static const char __pyx_k_matID[] =
"matID";
1838 static const char __pyx_k_numer[] =
"numer";
1839 static const char __pyx_k_numpy[] =
"numpy";
1840 static const char __pyx_k_pcBar[] =
"pcBar";
1841 static const char __pyx_k_q_dkr[] =
"q_dkr";
1842 static const char __pyx_k_q_dmt[] =
"q_dmt";
1843 static const char __pyx_k_range[] =
"range";
1844 static const char __pyx_k_shape[] =
"shape";
1845 static const char __pyx_k_u_dof[] =
"u_dof";
1846 static const char __pyx_k_u_l2g[] =
"u_l2g";
1847 static const char __pyx_k_vBar2[] =
"vBar2";
1848 static const char __pyx_k_vol_e[] =
"vol_e";
1849 static const char __pyx_k_zeros[] =
"zeros";
1850 static const char __pyx_k_a_neig[] =
"a_neig";
1851 static const char __pyx_k_colind[] =
"colind";
1852 static const char __pyx_k_dkr_up[] =
"dkr_up";
1853 static const char __pyx_k_import[] =
"__import__";
1854 static const char __pyx_k_mt_avg[] =
"mt_avg";
1855 static const char __pyx_k_nSpace[] =
"nSpace";
1856 static const char __pyx_k_phi_eN[] =
"phi_eN";
1857 static const char __pyx_k_picard[] =
"picard";
1858 static const char __pyx_k_q_alin[] =
"q_alin";
1859 static const char __pyx_k_q_detJ[] =
"q_detJ";
1860 static const char __pyx_k_q_flin[] =
"q_flin";
1861 static const char __pyx_k_q_mass[] =
"q_mass";
1862 static const char __pyx_k_q_vals[] =
"q_vals";
1863 static const char __pyx_k_rowptr[] =
"rowptr";
1864 static const char __pyx_k_thetaR[] =
"thetaR";
1865 static const char __pyx_k_thetaS[] =
"thetaS";
1866 static const char __pyx_k_thetaW[] =
"thetaW";
1867 static const char __pyx_k_u_neig[] =
"u_neig";
1868 static const char __pyx_k_volume[] =
"volume";
1869 static const char __pyx_k_weight[] =
"weight";
1870 static const char __pyx_k_df_dofs[] =
"df_dofs";
1871 static const char __pyx_k_eN_left[] =
"eN_left";
1872 static const char __pyx_k_gravity[] =
"gravity";
1873 static const char __pyx_k_kr_neig[] =
"kr_neig";
1874 static const char __pyx_k_nSpace2[] =
"nSpace2";
1875 static const char __pyx_k_omega_e[] =
"omega_e";
1876 static const char __pyx_k_pcBar_n[] =
"pcBar_n";
1877 static const char __pyx_k_q_dmass[] =
"q_dmass";
1878 static const char __pyx_k_q_kr_up[] =
"q_kr_up";
1879 static const char __pyx_k_thetaSR[] =
"thetaSR";
1880 static const char __pyx_k_dmtj_avg[] =
"dmtj_avg";
1881 static const char __pyx_k_eN_right[] =
"eN_right";
1882 static const char __pyx_k_ebq_vals[] =
"ebq_vals";
1883 static const char __pyx_k_integral[] =
"integral";
1884 static const char __pyx_k_material[] =
"material";
1885 static const char __pyx_k_phi_neig[] =
"phi_neig";
1886 static const char __pyx_k_q_grad_u[] =
"q_grad_u";
1887 static const char __pyx_k_q_grad_v[] =
"q_grad_v";
1888 static const char __pyx_k_q_grad_w[] =
"q_grad_w";
1889 static const char __pyx_k_ebN_local[] =
"ebN_local";
1890 static const char __pyx_k_pcBar_nM1[] =
"pcBar_nM1";
1891 static const char __pyx_k_pcBar_nM2[] =
"pcBar_nM2";
1892 static const char __pyx_k_sqrt_sBar[] =
"sqrt_sBar";
1893 static const char __pyx_k_transient[] =
"transient";
1894 static const char __pyx_k_volFactor[] =
"volFactor";
1895 static const char __pyx_k_zVelocity[] =
"zVelocity";
1896 static const char __pyx_k_zvelocity[] =
"zvelocity";
1897 static const char __pyx_k_DKWr_DpsiC[] =
"DKWr_DpsiC";
1898 static const char __pyx_k_matID_neig[] =
"matID_neig";
1899 static const char __pyx_k_nAvgWeight[] =
"nAvgWeight";
1900 static const char __pyx_k_upwindFlag[] =
"upwindFlag";
1901 static const char __pyx_k_DsBar_DpsiC[] =
"DsBar_DpsiC";
1902 static const char __pyx_k_DvBar_DpsiC[] =
"DvBar_DpsiC";
1903 static const char __pyx_k_ImportError[] =
"ImportError";
1904 static const char __pyx_k_eN_neighbor[] =
"eN_neighbor";
1905 static const char __pyx_k_tForReversal[] =
"tForReversal";
1906 static const char __pyx_k_DthetaW_DpsiC[] =
"DthetaW_DpsiC";
1907 static const char __pyx_k_material_left[] =
"material_left";
1908 static const char __pyx_k_weak_residual[] =
"weak_residual";
1909 static const char __pyx_k_material_right[] =
"material_right";
1910 static const char __pyx_k_ebq_global_vals[] =
"ebq_global_vals";
1911 static const char __pyx_k_elementJacobian[] =
"elementJacobian";
1912 static const char __pyx_k_elementResidual[] =
"elementResidual";
1913 static const char __pyx_k_onePlus_pcBar_n[] =
"onePlus_pcBar_n";
1914 static const char __pyx_k_nElements_global[] =
"nElements_global";
1915 static const char __pyx_k_nDOF_test_element[] =
"nDOF_test_element";
1916 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1917 static const char __pyx_k_material_functions[] =
"material_functions";
1918 static const char __pyx_k_nDOF_trial_element[] =
"nDOF_trial_element";
1919 static const char __pyx_k_updateMass_weakAvg[] =
"updateMass_weakAvg";
1920 static const char __pyx_k_calculateNormalFlux[] =
"calculateNormalFlux";
1921 static const char __pyx_k_thisElementIsUpwind[] =
"thisElementIsUpwind";
1922 static const char __pyx_k_elementBoundaryTypes[] =
"elementBoundaryTypes";
1923 static const char __pyx_k_elementMaterialTypes[] =
"elementMaterialTypes";
1924 static const char __pyx_k_elementNeighborsArray[] =
"elementNeighborsArray";
1925 static const char __pyx_k_elementBoundariesArray[] =
"elementBoundariesArray";
1926 static const char __pyx_k_jacobian_weak_residual[] =
"jacobian_weak_residual";
1927 static const char __pyx_k_characteristic_velocity[] =
"characteristic_velocity";
1928 static const char __pyx_k_elementBarycentersArray[] =
"elementBarycentersArray";
1929 static const char __pyx_k_nElementBoundaries_global[] =
"nElementBoundaries_global";
1930 static const char __pyx_k_setElementBoundariesArray[] =
"setElementBoundariesArray";
1931 static const char __pyx_k_RE_NCP1_getElementJacobian[] =
"RE_NCP1_getElementJacobian";
1932 static const char __pyx_k_RE_NCP1_getElementResidual[] =
"RE_NCP1_getElementResidual";
1933 static const char __pyx_k_nElementBoundaries_element[] =
"nElementBoundaries_element";
1934 static const char __pyx_k_updateMassJacobian_weakAvg[] =
"updateMassJacobian_weakAvg";
1935 static const char __pyx_k_vortexElementVelocityEval3[] =
"vortexElementVelocityEval3";
1936 static const char __pyx_k_vortexElementVelocityEval4[] =
"vortexElementVelocityEval4";
1937 static const char __pyx_k_helicalElementVelocityEval3[] =
"helicalElementVelocityEval3";
1938 static const char __pyx_k_helicalElementVelocityEval4[] =
"helicalElementVelocityEval4";
1939 static const char __pyx_k_characteristic_velocity_dofs[] =
"characteristic_velocity_dofs";
1940 static const char __pyx_k_elementBoundaryElementsArray[] =
"elementBoundaryElementsArray";
1941 static const char __pyx_k_elementBoundaryMaterialTypes[] =
"elementBoundaryMaterialTypes";
1942 static const char __pyx_k_subsurfaceTransportFunctions[] =
"subsurfaceTransportFunctions";
1943 static const char __pyx_k_exteriorElementBoundariesArray[] =
"exteriorElementBoundariesArray";
1944 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
1945 static const char __pyx_k_setExteriorElementBoundaryTypes[] =
"setExteriorElementBoundaryTypes";
1946 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie[] =
"RE_NCP1_evaluateElementCoefficients_Linear";
1947 static const char __pyx_k_computeSimpleCharacteristicVeloc[] =
"computeSimpleCharacteristicVelocityFromElementVelocity";
1948 static const char __pyx_k_evaluateScalarMaterialFunctionOv[] =
"evaluateScalarMaterialFunctionOverElements";
1949 static const char __pyx_k_evaluateSparseTensorMaterialFunc[] =
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1950 static const char __pyx_k_evaluateVectorMaterialFunctionOv[] =
"evaluateVectorMaterialFunctionOverElements";
1951 static const char __pyx_k_exteriorElementBoundaryMaterialT[] =
"exteriorElementBoundaryMaterialTypes";
1952 static const char __pyx_k_nExteriorElementBoundaries_globa[] =
"nExteriorElementBoundaries_global";
1953 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
1954 static const char __pyx_k_proteus_subsurfaceTransportFunct[] =
"proteus/subsurfaceTransportFunctions.pyx";
1955 static const char __pyx_k_rotatingGaussianElementVelocityE[] =
"rotatingGaussianElementVelocityEval3";
1956 static const char __pyx_k_setScalarMaterialFunctionOverEle[] =
"setScalarMaterialFunctionOverElements";
1957 static const char __pyx_k_setScalarMaterialFunctionOverGlo[] =
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1958 static const char __pyx_k_setSparseTensorMaterialFunctionO[] =
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1959 static const char __pyx_k_setVectorMaterialFunctionOverEle[] =
"setVectorMaterialFunctionOverElements";
1960 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie_2[] =
"RE_NCP1_evaluateElementCoefficients_VGM";
1961 static const char __pyx_k_computeSimpleCharacteristicVeloc_2[] =
"computeSimpleCharacteristicVelocityFromVelocityDOFs";
1962 static const char __pyx_k_evaluateScalarMaterialFunctionOv_2[] =
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1963 static const char __pyx_k_evaluateScalarMaterialFunctionOv_3[] =
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1964 static const char __pyx_k_evaluateSparseTensorMaterialFunc_2[] =
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1965 static const char __pyx_k_rotatingGaussianElementVelocityE_2[] =
"rotatingGaussianElementVelocityEval4";
1966 static const char __pyx_k_setScalarMaterialFunctionOverEle_2[] =
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1967 static const char __pyx_k_setSparseTensorMaterialFunctionO_2[] =
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1968 static PyObject *__pyx_n_s_DKWr_DpsiC;
1969 static PyObject *__pyx_n_s_DsBar_DpsiC;
1970 static PyObject *__pyx_n_s_DthetaW_DpsiC;
1971 static PyObject *__pyx_n_s_DvBar_DpsiC;
1972 static PyObject *__pyx_n_s_I;
1973 static PyObject *__pyx_n_s_ImportError;
1974 static PyObject *__pyx_n_s_J;
1975 static PyObject *__pyx_n_s_KWr;
1976 static PyObject *__pyx_n_s_KWs;
1977 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie;
1978 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2;
1979 static PyObject *__pyx_n_s_RE_NCP1_getElementJacobian;
1980 static PyObject *__pyx_n_s_RE_NCP1_getElementResidual;
1981 static PyObject *__pyx_n_s_a_avg;
1982 static PyObject *__pyx_n_s_a_eN;
1983 static PyObject *__pyx_n_s_a_neig;
1984 static PyObject *__pyx_n_s_a_up;
1985 static PyObject *__pyx_n_s_alpha;
1986 static PyObject *__pyx_n_s_beta;
1987 static PyObject *__pyx_n_s_calculateNormalFlux;
1988 static PyObject *__pyx_n_s_characteristic_velocity;
1989 static PyObject *__pyx_n_s_characteristic_velocity_dofs;
1990 static PyObject *__pyx_n_s_cline_in_traceback;
1991 static PyObject *__pyx_n_s_clock;
1992 static PyObject *__pyx_n_s_colind;
1993 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc;
1994 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc_2;
1995 static PyObject *__pyx_n_s_d;
1996 static PyObject *__pyx_n_s_dS;
1997 static PyObject *__pyx_n_s_dV;
1998 static PyObject *__pyx_n_s_denom;
1999 static PyObject *__pyx_n_s_df;
2000 static PyObject *__pyx_n_s_df_dofs;
2001 static PyObject *__pyx_n_s_dkr_up;
2002 static PyObject *__pyx_n_s_dm;
2003 static PyObject *__pyx_n_s_dmt;
2004 static PyObject *__pyx_n_s_dmtj_avg;
2005 static PyObject *__pyx_n_s_dot;
2006 static PyObject *__pyx_n_s_drhom;
2007 static PyObject *__pyx_n_s_eN;
2008 static PyObject *__pyx_n_s_eN_left;
2009 static PyObject *__pyx_n_s_eN_neighbor;
2010 static PyObject *__pyx_n_s_eN_right;
2011 static PyObject *__pyx_n_s_ebN;
2012 static PyObject *__pyx_n_s_ebNE;
2013 static PyObject *__pyx_n_s_ebN_local;
2014 static PyObject *__pyx_n_s_ebq_global_vals;
2015 static PyObject *__pyx_n_s_ebq_vals;
2016 static PyObject *__pyx_n_s_elementBarycentersArray;
2017 static PyObject *__pyx_n_s_elementBoundariesArray;
2018 static PyObject *__pyx_n_s_elementBoundaryElementsArray;
2019 static PyObject *__pyx_n_s_elementBoundaryMaterialTypes;
2020 static PyObject *__pyx_n_s_elementBoundaryTypes;
2021 static PyObject *__pyx_n_s_elementJacobian;
2022 static PyObject *__pyx_n_s_elementMaterialTypes;
2023 static PyObject *__pyx_n_s_elementNeighborsArray;
2024 static PyObject *__pyx_n_s_elementResidual;
2025 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv;
2026 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_2;
2027 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_3;
2028 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc;
2029 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc_2;
2030 static PyObject *__pyx_n_s_evaluateVectorMaterialFunctionOv;
2031 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
2032 static PyObject *__pyx_n_s_exteriorElementBoundaryMaterialT;
2033 static PyObject *__pyx_n_s_f_up;
2034 static PyObject *__pyx_n_s_flat;
2035 static PyObject *__pyx_n_s_flux;
2036 static PyObject *__pyx_n_s_gravity;
2037 static PyObject *__pyx_n_s_helicalElementVelocityEval3;
2038 static PyObject *__pyx_n_s_helicalElementVelocityEval4;
2039 static PyObject *__pyx_n_s_i;
2040 static PyObject *__pyx_n_s_ii;
2041 static PyObject *__pyx_n_s_import;
2042 static PyObject *__pyx_n_s_integral;
2043 static PyObject *__pyx_n_s_j;
2044 static PyObject *__pyx_n_s_jacobian_weak_residual;
2045 static PyObject *__pyx_n_s_k;
2046 static PyObject *__pyx_n_s_kb;
2047 static PyObject *__pyx_n_s_kr_eN;
2048 static PyObject *__pyx_n_s_kr_neig;
2049 static PyObject *__pyx_n_s_l2g;
2050 static PyObject *__pyx_n_s_m;
2051 static PyObject *__pyx_n_s_main;
2052 static PyObject *__pyx_n_s_matID;
2053 static PyObject *__pyx_n_s_matID_neig;
2054 static PyObject *__pyx_n_s_material;
2055 static PyObject *__pyx_n_s_material_functions;
2056 static PyObject *__pyx_n_s_material_left;
2057 static PyObject *__pyx_n_s_material_right;
2058 static PyObject *__pyx_n_s_mt;
2059 static PyObject *__pyx_n_s_mt_avg;
2060 static PyObject *__pyx_n_s_n;
2061 static PyObject *__pyx_n_s_nAvgWeight;
2062 static PyObject *__pyx_n_s_nDOF_test_element;
2063 static PyObject *__pyx_n_s_nDOF_trial_element;
2064 static PyObject *__pyx_n_s_nElementBoundaries_element;
2065 static PyObject *__pyx_n_s_nElementBoundaries_global;
2066 static PyObject *__pyx_n_s_nElements_global;
2067 static PyObject *__pyx_n_s_nExteriorElementBoundaries_globa;
2068 static PyObject *__pyx_n_s_nSpace;
2069 static PyObject *__pyx_n_s_nSpace2;
2070 static PyObject *__pyx_n_s_name;
2071 static PyObject *__pyx_n_s_nd;
2072 static PyObject *__pyx_n_s_nnz;
2073 static PyObject *__pyx_n_s_numer;
2074 static PyObject *__pyx_n_s_numpy;
2075 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2076 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2077 static PyObject *__pyx_n_s_omega_e;
2078 static PyObject *__pyx_n_s_one8;
2079 static PyObject *__pyx_n_s_onePlus_pcBar_n;
2080 static PyObject *__pyx_n_s_pcBar;
2081 static PyObject *__pyx_n_s_pcBar_n;
2082 static PyObject *__pyx_n_s_pcBar_nM1;
2083 static PyObject *__pyx_n_s_pcBar_nM2;
2084 static PyObject *__pyx_n_s_phi_eN;
2085 static PyObject *__pyx_n_s_phi_neig;
2086 static PyObject *__pyx_n_s_pi;
2087 static PyObject *__pyx_n_s_picard;
2088 static PyObject *__pyx_kp_s_proteus_subsurfaceTransportFunct;
2089 static PyObject *__pyx_n_s_psiC;
2090 static PyObject *__pyx_n_s_q;
2091 static PyObject *__pyx_n_s_q_alin;
2092 static PyObject *__pyx_n_s_q_detJ;
2093 static PyObject *__pyx_n_s_q_dkr;
2094 static PyObject *__pyx_n_s_q_dm;
2095 static PyObject *__pyx_n_s_q_dmass;
2096 static PyObject *__pyx_n_s_q_dmt;
2097 static PyObject *__pyx_n_s_q_flin;
2098 static PyObject *__pyx_n_s_q_grad_u;
2099 static PyObject *__pyx_n_s_q_grad_v;
2100 static PyObject *__pyx_n_s_q_grad_w;
2101 static PyObject *__pyx_n_s_q_kr;
2102 static PyObject *__pyx_n_s_q_kr_up;
2103 static PyObject *__pyx_n_s_q_m;
2104 static PyObject *__pyx_n_s_q_mass;
2105 static PyObject *__pyx_n_s_q_mt;
2106 static PyObject *__pyx_n_s_q_r;
2107 static PyObject *__pyx_n_s_q_u;
2108 static PyObject *__pyx_n_s_q_vals;
2109 static PyObject *__pyx_n_s_q_x;
2110 static PyObject *__pyx_n_s_range;
2111 static PyObject *__pyx_n_s_rho;
2112 static PyObject *__pyx_n_s_rho2;
2113 static PyObject *__pyx_n_s_rhom;
2114 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE;
2115 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE_2;
2116 static PyObject *__pyx_n_s_rowptr;
2117 static PyObject *__pyx_n_s_sBar;
2118 static PyObject *__pyx_n_s_setElementBoundariesArray;
2119 static PyObject *__pyx_n_s_setExteriorElementBoundaryTypes;
2120 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle;
2121 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle_2;
2122 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverGlo;
2123 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO;
2124 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO_2;
2125 static PyObject *__pyx_n_s_setVectorMaterialFunctionOverEle;
2126 static PyObject *__pyx_n_s_shape;
2127 static PyObject *__pyx_n_s_sqrt_sBar;
2128 static PyObject *__pyx_n_s_subsurfaceTransportFunctions;
2129 static PyObject *__pyx_n_s_sum;
2130 static PyObject *__pyx_n_s_t;
2131 static PyObject *__pyx_n_s_tForReversal;
2132 static PyObject *__pyx_n_s_test;
2133 static PyObject *__pyx_n_s_thetaR;
2134 static PyObject *__pyx_n_s_thetaS;
2135 static PyObject *__pyx_n_s_thetaSR;
2136 static PyObject *__pyx_n_s_thetaW;
2137 static PyObject *__pyx_n_s_thisElementIsUpwind;
2138 static PyObject *__pyx_n_s_transient;
2139 static PyObject *__pyx_n_s_u_dof;
2140 static PyObject *__pyx_n_s_u_eN;
2141 static PyObject *__pyx_n_s_u_j;
2142 static PyObject *__pyx_n_s_u_l2g;
2143 static PyObject *__pyx_n_s_u_neig;
2144 static PyObject *__pyx_n_s_updateMassJacobian_weakAvg;
2145 static PyObject *__pyx_n_s_updateMass_weakAvg;
2146 static PyObject *__pyx_n_s_upwindFlag;
2147 static PyObject *__pyx_n_s_v;
2148 static PyObject *__pyx_n_s_vBar;
2149 static PyObject *__pyx_n_s_vBar2;
2150 static PyObject *__pyx_n_s_vol;
2151 static PyObject *__pyx_n_s_volFactor;
2152 static PyObject *__pyx_n_s_vol_e;
2153 static PyObject *__pyx_n_s_volume;
2154 static PyObject *__pyx_n_s_vortexElementVelocityEval3;
2155 static PyObject *__pyx_n_s_vortexElementVelocityEval4;
2156 static PyObject *__pyx_n_s_w;
2157 static PyObject *__pyx_n_s_weak_residual;
2158 static PyObject *__pyx_n_s_weight;
2159 static PyObject *__pyx_n_s_x;
2160 static PyObject *__pyx_n_s_xc;
2161 static PyObject *__pyx_n_s_yc;
2162 static PyObject *__pyx_n_s_zVelocity;
2163 static PyObject *__pyx_n_s_zeros;
2164 static PyObject *__pyx_n_s_zvelocity;
2165 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes);
2166 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes);
2167 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2168 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2169 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2170 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2171 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2172 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2173 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2174 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2175 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2176 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2177 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2178 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2179 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin);
2180 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up);
2181 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual);
2182 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian);
2183 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual);
2184 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual);
2185 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux);
2186 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
2187 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
2188 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
2189 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
2190 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2191 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2192 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2193 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2194 static PyObject *__pyx_float_0_0;
2195 static PyObject *__pyx_float_0_5;
2196 static PyObject *__pyx_float_2_0;
2197 static PyObject *__pyx_float_1_0eneg_20;
2198 static PyObject *__pyx_slice_;
2199 static PyObject *__pyx_tuple__2;
2200 static PyObject *__pyx_tuple__3;
2201 static PyObject *__pyx_tuple__4;
2202 static PyObject *__pyx_tuple__6;
2203 static PyObject *__pyx_tuple__8;
2204 static PyObject *__pyx_tuple__10;
2205 static PyObject *__pyx_tuple__12;
2206 static PyObject *__pyx_tuple__14;
2207 static PyObject *__pyx_tuple__16;
2208 static PyObject *__pyx_tuple__18;
2209 static PyObject *__pyx_tuple__20;
2210 static PyObject *__pyx_tuple__22;
2211 static PyObject *__pyx_tuple__24;
2212 static PyObject *__pyx_tuple__26;
2213 static PyObject *__pyx_tuple__28;
2214 static PyObject *__pyx_tuple__30;
2215 static PyObject *__pyx_tuple__32;
2216 static PyObject *__pyx_tuple__34;
2217 static PyObject *__pyx_tuple__36;
2218 static PyObject *__pyx_tuple__38;
2219 static PyObject *__pyx_tuple__40;
2220 static PyObject *__pyx_tuple__42;
2221 static PyObject *__pyx_tuple__44;
2222 static PyObject *__pyx_tuple__46;
2223 static PyObject *__pyx_tuple__48;
2224 static PyObject *__pyx_tuple__50;
2225 static PyObject *__pyx_tuple__52;
2226 static PyObject *__pyx_tuple__54;
2227 static PyObject *__pyx_tuple__56;
2228 static PyObject *__pyx_tuple__58;
2229 static PyObject *__pyx_tuple__60;
2230 static PyObject *__pyx_codeobj__5;
2231 static PyObject *__pyx_codeobj__7;
2232 static PyObject *__pyx_codeobj__9;
2233 static PyObject *__pyx_codeobj__11;
2234 static PyObject *__pyx_codeobj__13;
2235 static PyObject *__pyx_codeobj__15;
2236 static PyObject *__pyx_codeobj__17;
2237 static PyObject *__pyx_codeobj__19;
2238 static PyObject *__pyx_codeobj__21;
2239 static PyObject *__pyx_codeobj__23;
2240 static PyObject *__pyx_codeobj__25;
2241 static PyObject *__pyx_codeobj__27;
2242 static PyObject *__pyx_codeobj__29;
2243 static PyObject *__pyx_codeobj__31;
2244 static PyObject *__pyx_codeobj__33;
2245 static PyObject *__pyx_codeobj__35;
2246 static PyObject *__pyx_codeobj__37;
2247 static PyObject *__pyx_codeobj__39;
2248 static PyObject *__pyx_codeobj__41;
2249 static PyObject *__pyx_codeobj__43;
2250 static PyObject *__pyx_codeobj__45;
2251 static PyObject *__pyx_codeobj__47;
2252 static PyObject *__pyx_codeobj__49;
2253 static PyObject *__pyx_codeobj__51;
2254 static PyObject *__pyx_codeobj__53;
2255 static PyObject *__pyx_codeobj__55;
2256 static PyObject *__pyx_codeobj__57;
2257 static PyObject *__pyx_codeobj__59;
2258 static PyObject *__pyx_codeobj__61;
2269 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_max(
double __pyx_v_a,
double __pyx_v_b) {
2271 __Pyx_RefNannyDeclarations
2273 __Pyx_RefNannySetupContext(
"double_max", 0);
2274 if (((__pyx_v_a >= __pyx_v_b) != 0)) {
2275 __pyx_t_1 = __pyx_v_a;
2277 __pyx_t_1 = __pyx_v_b;
2279 __pyx_r = __pyx_t_1;
2284 __Pyx_RefNannyFinishContext();
2296 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_min(
double __pyx_v_a,
double __pyx_v_b) {
2298 __Pyx_RefNannyDeclarations
2300 __Pyx_RefNannySetupContext(
"double_min", 0);
2301 if (((__pyx_v_a <= __pyx_v_b) != 0)) {
2302 __pyx_t_1 = __pyx_v_a;
2304 __pyx_t_1 = __pyx_v_b;
2306 __pyx_r = __pyx_t_1;
2311 __Pyx_RefNannyFinishContext();
2324 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2325 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes = {
"setExteriorElementBoundaryTypes", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, METH_VARARGS|METH_KEYWORDS, 0};
2326 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2327 int __pyx_v_nExteriorElementBoundaries_global;
2328 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
2329 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2330 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2331 PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes = 0;
2332 int __pyx_lineno = 0;
2333 const char *__pyx_filename = NULL;
2334 int __pyx_clineno = 0;
2335 PyObject *__pyx_r = 0;
2336 __Pyx_RefNannyDeclarations
2337 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes (wrapper)", 0);
2339 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nExteriorElementBoundaries_globa,&__pyx_n_s_exteriorElementBoundariesArray,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_exteriorElementBoundaryMaterialT,0};
2340 PyObject* values[5] = {0,0,0,0,0};
2341 if (unlikely(__pyx_kwds)) {
2343 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2345 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2347 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2349 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2351 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2353 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2356 default:
goto __pyx_L5_argtuple_error;
2358 kw_args = PyDict_Size(__pyx_kwds);
2361 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nExteriorElementBoundaries_globa)) != 0)) kw_args--;
2362 else goto __pyx_L5_argtuple_error;
2365 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundariesArray)) != 0)) kw_args--;
2367 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 1); __PYX_ERR(0, 18, __pyx_L3_error)
2371 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2373 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 2); __PYX_ERR(0, 18, __pyx_L3_error)
2377 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2379 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 3); __PYX_ERR(0, 18, __pyx_L3_error)
2383 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundaryMaterialT)) != 0)) kw_args--;
2385 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 4); __PYX_ERR(0, 18, __pyx_L3_error)
2388 if (unlikely(kw_args > 0)) {
2389 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setExteriorElementBoundaryTypes") < 0)) __PYX_ERR(0, 18, __pyx_L3_error)
2391 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
2392 goto __pyx_L5_argtuple_error;
2394 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2395 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2396 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2397 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2398 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2400 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error)
2401 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[1]);
2402 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[2]);
2403 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[3]);
2404 __pyx_v_exteriorElementBoundaryMaterialTypes = ((PyArrayObject *)values[4]);
2406 goto __pyx_L4_argument_unpacking_done;
2407 __pyx_L5_argtuple_error:;
2408 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 18, __pyx_L3_error)
2410 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2411 __Pyx_RefNannyFinishContext();
2413 __pyx_L4_argument_unpacking_done:;
2414 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundariesArray", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
2415 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
2416 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
2417 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
2418 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(__pyx_self, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_exteriorElementBoundaryMaterialTypes);
2425 __Pyx_RefNannyFinishContext();
2429 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes) {
2433 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2434 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2435 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2436 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2437 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundariesArray;
2438 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundariesArray;
2439 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes;
2440 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2441 PyObject *__pyx_r = NULL;
2442 __Pyx_RefNannyDeclarations
2446 Py_ssize_t __pyx_t_4;
2448 Py_ssize_t __pyx_t_6;
2449 int __pyx_lineno = 0;
2450 const char *__pyx_filename = NULL;
2451 int __pyx_clineno = 0;
2452 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes", 0);
2453 __pyx_pybuffer_exteriorElementBoundariesArray.pybuffer.buf = NULL;
2454 __pyx_pybuffer_exteriorElementBoundariesArray.refcount = 0;
2455 __pyx_pybuffernd_exteriorElementBoundariesArray.data = NULL;
2456 __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer = &__pyx_pybuffer_exteriorElementBoundariesArray;
2457 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2458 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2459 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2460 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2461 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2462 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2463 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2464 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2465 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.pybuffer.buf = NULL;
2466 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.refcount = 0;
2467 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.data = NULL;
2468 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2470 __Pyx_BufFmt_StackElem __pyx_stack[1];
2471 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2473 __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.shape[0];
2475 __Pyx_BufFmt_StackElem __pyx_stack[1];
2476 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2478 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2480 __Pyx_BufFmt_StackElem __pyx_stack[1];
2481 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2483 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2485 __Pyx_BufFmt_StackElem __pyx_stack[1];
2486 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2488 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0];
2497 __pyx_t_1 = __pyx_v_nExteriorElementBoundaries_global;
2498 __pyx_t_2 = __pyx_t_1;
2499 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2500 __pyx_v_ebNE = __pyx_t_3;
2509 __pyx_t_4 = __pyx_v_ebNE;
2511 if (__pyx_t_4 < 0) {
2512 __pyx_t_4 += __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape;
2513 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2514 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape)) __pyx_t_5 = 0;
2515 if (unlikely(__pyx_t_5 != -1)) {
2516 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2517 __PYX_ERR(0, 25, __pyx_L1_error)
2519 __pyx_v_ebN = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides));
2528 __pyx_t_4 = __pyx_v_ebN;
2531 if (__pyx_t_4 < 0) {
2532 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2533 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2534 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_5 = 0;
2535 if (__pyx_t_6 < 0) {
2536 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2537 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 1;
2538 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_5 = 1;
2539 if (unlikely(__pyx_t_5 != -1)) {
2540 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2541 __PYX_ERR(0, 26, __pyx_L1_error)
2543 __pyx_v_eN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2552 __pyx_t_6 = __pyx_v_eN;
2554 if (__pyx_t_6 < 0) {
2555 __pyx_t_6 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2556 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
2557 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2558 if (unlikely(__pyx_t_5 != -1)) {
2559 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2560 __PYX_ERR(0, 27, __pyx_L1_error)
2562 __pyx_t_4 = __pyx_v_ebNE;
2564 if (__pyx_t_4 < 0) {
2565 __pyx_t_4 += __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape;
2566 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2567 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2568 if (unlikely(__pyx_t_5 != -1)) {
2569 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2570 __PYX_ERR(0, 27, __pyx_L1_error)
2572 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2584 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2587 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2588 __Pyx_PyThreadState_declare
2589 __Pyx_PyThreadState_assign
2590 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2591 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2592 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2593 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2594 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2595 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2596 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2600 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2601 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2602 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2603 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2605 __Pyx_XGIVEREF(__pyx_r);
2606 __Pyx_RefNannyFinishContext();
2619 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2620 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray = {
"setElementBoundariesArray", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray, METH_VARARGS|METH_KEYWORDS, 0};
2621 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2622 int __pyx_v_nElementBoundaries_global;
2623 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2624 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2625 PyArrayObject *__pyx_v_elementBoundaryMaterialTypes = 0;
2626 int __pyx_lineno = 0;
2627 const char *__pyx_filename = NULL;
2628 int __pyx_clineno = 0;
2629 PyObject *__pyx_r = 0;
2630 __Pyx_RefNannyDeclarations
2631 __Pyx_RefNannySetupContext(
"setElementBoundariesArray (wrapper)", 0);
2633 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nElementBoundaries_global,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_elementBoundaryMaterialTypes,0};
2634 PyObject* values[4] = {0,0,0,0};
2635 if (unlikely(__pyx_kwds)) {
2637 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2639 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2641 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2643 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2645 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2648 default:
goto __pyx_L5_argtuple_error;
2650 kw_args = PyDict_Size(__pyx_kwds);
2653 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_global)) != 0)) kw_args--;
2654 else goto __pyx_L5_argtuple_error;
2657 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2659 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 1); __PYX_ERR(0, 29, __pyx_L3_error)
2663 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2665 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 2); __PYX_ERR(0, 29, __pyx_L3_error)
2669 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryMaterialTypes)) != 0)) kw_args--;
2671 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 3); __PYX_ERR(0, 29, __pyx_L3_error)
2674 if (unlikely(kw_args > 0)) {
2675 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setElementBoundariesArray") < 0)) __PYX_ERR(0, 29, __pyx_L3_error)
2677 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2678 goto __pyx_L5_argtuple_error;
2680 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2681 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2682 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2683 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2685 __pyx_v_nElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
2686 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[1]);
2687 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[2]);
2688 __pyx_v_elementBoundaryMaterialTypes = ((PyArrayObject *)values[3]);
2690 goto __pyx_L4_argument_unpacking_done;
2691 __pyx_L5_argtuple_error:;
2692 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 29, __pyx_L3_error)
2694 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2695 __Pyx_RefNannyFinishContext();
2697 __pyx_L4_argument_unpacking_done:;
2698 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 30, __pyx_L1_error)
2699 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 31, __pyx_L1_error)
2700 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
2701 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(__pyx_self, __pyx_v_nElementBoundaries_global, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_elementBoundaryMaterialTypes);
2708 __Pyx_RefNannyFinishContext();
2712 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes) {
2714 int __pyx_v_eN_left;
2715 int __pyx_v_eN_right;
2716 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2717 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2718 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryMaterialTypes;
2719 __Pyx_Buffer __pyx_pybuffer_elementBoundaryMaterialTypes;
2720 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2721 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2722 PyObject *__pyx_r = NULL;
2723 __Pyx_RefNannyDeclarations
2727 Py_ssize_t __pyx_t_4;
2728 Py_ssize_t __pyx_t_5;
2730 Py_ssize_t __pyx_t_7;
2732 int __pyx_lineno = 0;
2733 const char *__pyx_filename = NULL;
2734 int __pyx_clineno = 0;
2735 __Pyx_RefNannySetupContext(
"setElementBoundariesArray", 0);
2736 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2737 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2738 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2739 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2740 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2741 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2742 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2743 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2744 __pyx_pybuffer_elementBoundaryMaterialTypes.pybuffer.buf = NULL;
2745 __pyx_pybuffer_elementBoundaryMaterialTypes.refcount = 0;
2746 __pyx_pybuffernd_elementBoundaryMaterialTypes.data = NULL;
2747 __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryMaterialTypes;
2749 __Pyx_BufFmt_StackElem __pyx_stack[1];
2750 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2752 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2754 __Pyx_BufFmt_StackElem __pyx_stack[1];
2755 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2757 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2759 __Pyx_BufFmt_StackElem __pyx_stack[1];
2760 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2762 __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[1];
2771 __pyx_t_1 = __pyx_v_nElementBoundaries_global;
2772 __pyx_t_2 = __pyx_t_1;
2773 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2774 __pyx_v_ebN = __pyx_t_3;
2783 __pyx_t_4 = __pyx_v_ebN;
2786 if (__pyx_t_4 < 0) {
2787 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2788 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2789 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
2790 if (__pyx_t_5 < 0) {
2791 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2792 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
2793 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
2794 if (unlikely(__pyx_t_6 != -1)) {
2795 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2796 __PYX_ERR(0, 35, __pyx_L1_error)
2798 __pyx_v_eN_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2807 __pyx_t_5 = __pyx_v_ebN;
2810 if (__pyx_t_5 < 0) {
2811 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2812 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
2813 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
2814 if (__pyx_t_4 < 0) {
2815 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2816 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
2817 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
2818 if (unlikely(__pyx_t_6 != -1)) {
2819 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2820 __PYX_ERR(0, 36, __pyx_L1_error)
2822 __pyx_v_eN_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2831 __pyx_t_4 = __pyx_v_eN_left;
2833 if (__pyx_t_4 < 0) {
2834 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2835 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2836 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2837 if (unlikely(__pyx_t_6 != -1)) {
2838 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2839 __PYX_ERR(0, 37, __pyx_L1_error)
2841 __pyx_t_5 = __pyx_v_ebN;
2844 if (__pyx_t_5 < 0) {
2845 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2846 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
2847 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2848 if (__pyx_t_7 < 0) {
2849 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2850 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 1;
2851 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2852 if (unlikely(__pyx_t_6 != -1)) {
2853 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2854 __PYX_ERR(0, 37, __pyx_L1_error)
2856 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2865 __pyx_t_4 = __pyx_v_eN_left;
2867 if (__pyx_t_4 < 0) {
2868 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2869 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2870 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2871 if (unlikely(__pyx_t_6 != -1)) {
2872 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2873 __PYX_ERR(0, 38, __pyx_L1_error)
2875 __pyx_t_7 = __pyx_v_ebN;
2878 if (__pyx_t_7 < 0) {
2879 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2880 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
2881 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2882 if (__pyx_t_5 < 0) {
2883 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2884 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
2885 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2886 if (unlikely(__pyx_t_6 != -1)) {
2887 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2888 __PYX_ERR(0, 38, __pyx_L1_error)
2890 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2899 __pyx_t_8 = ((__pyx_v_eN_right >= 0) != 0);
2909 __pyx_t_4 = __pyx_v_eN_right;
2911 if (__pyx_t_4 < 0) {
2912 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2913 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2914 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2915 if (unlikely(__pyx_t_6 != -1)) {
2916 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2917 __PYX_ERR(0, 40, __pyx_L1_error)
2919 __pyx_t_5 = __pyx_v_ebN;
2922 if (__pyx_t_5 < 0) {
2923 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2924 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
2925 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2926 if (__pyx_t_7 < 0) {
2927 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2928 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 1;
2929 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2930 if (unlikely(__pyx_t_6 != -1)) {
2931 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2932 __PYX_ERR(0, 40, __pyx_L1_error)
2934 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2955 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2958 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2959 __Pyx_PyThreadState_declare
2960 __Pyx_PyThreadState_assign
2961 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2962 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2963 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2964 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2965 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2966 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2970 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2971 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2972 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2974 __Pyx_XGIVEREF(__pyx_r);
2975 __Pyx_RefNannyFinishContext();
2988 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2989 static char __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and set is material j\n likely little improvement right now without correct typing of material_functions\n ";
2990 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements = {
"setScalarMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements};
2991 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2992 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2993 PyArrayObject *__pyx_v_q_vals = 0;
2994 PyObject *__pyx_v_material_functions = 0;
2995 int __pyx_lineno = 0;
2996 const char *__pyx_filename = NULL;
2997 int __pyx_clineno = 0;
2998 PyObject *__pyx_r = 0;
2999 __Pyx_RefNannyDeclarations
3000 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements (wrapper)", 0);
3002 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
3003 PyObject* values[3] = {0,0,0};
3004 if (unlikely(__pyx_kwds)) {
3006 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3008 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3010 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3012 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3015 default:
goto __pyx_L5_argtuple_error;
3017 kw_args = PyDict_Size(__pyx_kwds);
3020 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
3021 else goto __pyx_L5_argtuple_error;
3024 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
3026 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 43, __pyx_L3_error)
3030 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3032 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 43, __pyx_L3_error)
3035 if (unlikely(kw_args > 0)) {
3036 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 43, __pyx_L3_error)
3038 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3039 goto __pyx_L5_argtuple_error;
3041 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3042 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3043 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3045 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
3046 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
3047 __pyx_v_material_functions = ((PyObject*)values[2]);
3049 goto __pyx_L4_argument_unpacking_done;
3050 __pyx_L5_argtuple_error:;
3051 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 43, __pyx_L3_error)
3053 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3054 __Pyx_RefNannyFinishContext();
3056 __pyx_L4_argument_unpacking_done:;
3057 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 43, __pyx_L1_error)
3058 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 44, __pyx_L1_error)
3059 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 45, __pyx_L1_error)
3060 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
3067 __Pyx_RefNannyFinishContext();
3071 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
3074 int __pyx_v_material;
3075 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
3076 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
3077 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
3078 __Pyx_Buffer __pyx_pybuffer_q_vals;
3079 PyObject *__pyx_r = NULL;
3080 __Pyx_RefNannyDeclarations
3084 Py_ssize_t __pyx_t_4;
3088 PyObject *__pyx_t_8 = NULL;
3089 PyObject *__pyx_t_9 = NULL;
3090 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_10;
3091 Py_ssize_t __pyx_t_11;
3093 int __pyx_lineno = 0;
3094 const char *__pyx_filename = NULL;
3095 int __pyx_clineno = 0;
3096 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements", 0);
3097 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
3098 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
3099 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
3100 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
3101 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
3102 __pyx_pybuffer_q_vals.refcount = 0;
3103 __pyx_pybuffernd_q_vals.data = NULL;
3104 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
3106 __Pyx_BufFmt_StackElem __pyx_stack[1];
3107 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
3109 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
3111 __Pyx_BufFmt_StackElem __pyx_stack[1];
3112 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
3114 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
3123 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
3124 __pyx_t_2 = __pyx_t_1;
3125 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3126 __pyx_v_eN = __pyx_t_3;
3135 __pyx_t_4 = __pyx_v_eN;
3137 if (__pyx_t_4 < 0) {
3138 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3139 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
3140 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
3141 if (unlikely(__pyx_t_5 != -1)) {
3142 __Pyx_RaiseBufferIndexError(__pyx_t_5);
3143 __PYX_ERR(0, 52, __pyx_L1_error)
3145 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3154 __pyx_t_6 = (__pyx_v_q_vals->dimensions[1]);
3155 __pyx_t_7 = __pyx_t_6;
3156 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
3157 __pyx_v_k = __pyx_t_5;
3166 if (unlikely(__pyx_v_material_functions == Py_None)) {
3167 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3168 __PYX_ERR(0, 54, __pyx_L1_error)
3170 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error)
3171 __Pyx_GOTREF(__pyx_t_8);
3172 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 54, __pyx_L1_error)
3173 __Pyx_GOTREF(__pyx_t_9);
3174 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3175 __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_9);
if (unlikely((__pyx_t_10 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
3176 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3177 __pyx_t_4 = __pyx_v_eN;
3178 __pyx_t_11 = __pyx_v_k;
3180 if (__pyx_t_4 < 0) {
3181 __pyx_t_4 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
3182 if (unlikely(__pyx_t_4 < 0)) __pyx_t_12 = 0;
3183 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_12 = 0;
3184 if (__pyx_t_11 < 0) {
3185 __pyx_t_11 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
3186 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 1;
3187 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_12 = 1;
3188 if (unlikely(__pyx_t_12 != -1)) {
3189 __Pyx_RaiseBufferIndexError(__pyx_t_12);
3190 __PYX_ERR(0, 54, __pyx_L1_error)
3192 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_10;
3205 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3208 __Pyx_XDECREF(__pyx_t_8);
3209 __Pyx_XDECREF(__pyx_t_9);
3210 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3211 __Pyx_PyThreadState_declare
3212 __Pyx_PyThreadState_assign
3213 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3214 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3215 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3216 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3217 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3221 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3222 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3224 __Pyx_XGIVEREF(__pyx_r);
3225 __Pyx_RefNannyFinishContext();
3238 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3239 static char __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and set \013ec f_j assuming element is material j\n ";
3240 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements = {
"setVectorMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements};
3241 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3242 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
3243 PyArrayObject *__pyx_v_q_vals = 0;
3244 PyObject *__pyx_v_material_functions = 0;
3245 int __pyx_lineno = 0;
3246 const char *__pyx_filename = NULL;
3247 int __pyx_clineno = 0;
3248 PyObject *__pyx_r = 0;
3249 __Pyx_RefNannyDeclarations
3250 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements (wrapper)", 0);
3252 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
3253 PyObject* values[3] = {0,0,0};
3254 if (unlikely(__pyx_kwds)) {
3256 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3258 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3260 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3262 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3265 default:
goto __pyx_L5_argtuple_error;
3267 kw_args = PyDict_Size(__pyx_kwds);
3270 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
3271 else goto __pyx_L5_argtuple_error;
3274 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
3276 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 56, __pyx_L3_error)
3280 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3282 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 56, __pyx_L3_error)
3285 if (unlikely(kw_args > 0)) {
3286 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 56, __pyx_L3_error)
3288 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3289 goto __pyx_L5_argtuple_error;
3291 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3292 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3293 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3295 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
3296 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
3297 __pyx_v_material_functions = ((PyObject*)values[2]);
3299 goto __pyx_L4_argument_unpacking_done;
3300 __pyx_L5_argtuple_error:;
3301 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error)
3303 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3304 __Pyx_RefNannyFinishContext();
3306 __pyx_L4_argument_unpacking_done:;
3307 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 56, __pyx_L1_error)
3308 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 57, __pyx_L1_error)
3309 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 58, __pyx_L1_error)
3310 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
3317 __Pyx_RefNannyFinishContext();
3321 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
3324 int __pyx_v_material;
3325 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
3326 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
3327 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
3328 __Pyx_Buffer __pyx_pybuffer_q_vals;
3329 PyObject *__pyx_r = NULL;
3330 __Pyx_RefNannyDeclarations
3334 Py_ssize_t __pyx_t_4;
3338 PyObject *__pyx_t_8 = NULL;
3339 PyObject *__pyx_t_9 = NULL;
3340 PyObject *__pyx_t_10 = NULL;
3341 PyObject *__pyx_t_11 = NULL;
3342 int __pyx_lineno = 0;
3343 const char *__pyx_filename = NULL;
3344 int __pyx_clineno = 0;
3345 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements", 0);
3346 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
3347 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
3348 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
3349 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
3350 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
3351 __pyx_pybuffer_q_vals.refcount = 0;
3352 __pyx_pybuffernd_q_vals.data = NULL;
3353 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
3355 __Pyx_BufFmt_StackElem __pyx_stack[1];
3356 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3358 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
3360 __Pyx_BufFmt_StackElem __pyx_stack[1];
3361 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3363 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
3372 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
3373 __pyx_t_2 = __pyx_t_1;
3374 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3375 __pyx_v_eN = __pyx_t_3;
3384 __pyx_t_4 = __pyx_v_eN;
3386 if (__pyx_t_4 < 0) {
3387 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3388 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
3389 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
3390 if (unlikely(__pyx_t_5 != -1)) {
3391 __Pyx_RaiseBufferIndexError(__pyx_t_5);
3392 __PYX_ERR(0, 64, __pyx_L1_error)
3394 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3403 __pyx_t_6 = (__pyx_v_q_vals->dimensions[1]);
3404 __pyx_t_7 = __pyx_t_6;
3405 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
3406 __pyx_v_k = __pyx_t_5;
3415 if (unlikely(__pyx_v_material_functions == Py_None)) {
3416 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3417 __PYX_ERR(0, 66, __pyx_L1_error)
3419 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3420 __Pyx_GOTREF(__pyx_t_8);
3421 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
3422 __Pyx_GOTREF(__pyx_t_9);
3423 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3424 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_flat);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3425 __Pyx_GOTREF(__pyx_t_8);
3426 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3427 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
3428 __Pyx_GOTREF(__pyx_t_9);
3429 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error)
3430 __Pyx_GOTREF(__pyx_t_10);
3431 __pyx_t_11 = PyTuple_New(3);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 66, __pyx_L1_error)
3432 __Pyx_GOTREF(__pyx_t_11);
3433 __Pyx_GIVEREF(__pyx_t_9);
3434 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
3435 __Pyx_GIVEREF(__pyx_t_10);
3436 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
3437 __Pyx_INCREF(__pyx_slice_);
3438 __Pyx_GIVEREF(__pyx_slice_);
3439 PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_slice_);
3442 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_11, __pyx_t_8) < 0)) __PYX_ERR(0, 66, __pyx_L1_error)
3443 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3444 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3457 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3460 __Pyx_XDECREF(__pyx_t_8);
3461 __Pyx_XDECREF(__pyx_t_9);
3462 __Pyx_XDECREF(__pyx_t_10);
3463 __Pyx_XDECREF(__pyx_t_11);
3464 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3465 __Pyx_PyThreadState_declare
3466 __Pyx_PyThreadState_assign
3467 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3468 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3469 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3470 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3471 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3475 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3476 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3478 __Pyx_XGIVEREF(__pyx_r);
3479 __Pyx_RefNannyFinishContext();
3492 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3493 static char __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and set f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3494 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
3495 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3496 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3497 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3498 PyArrayObject *__pyx_v_ebq_vals = 0;
3499 PyObject *__pyx_v_material_functions = 0;
3500 int __pyx_lineno = 0;
3501 const char *__pyx_filename = NULL;
3502 int __pyx_clineno = 0;
3503 PyObject *__pyx_r = 0;
3504 __Pyx_RefNannyDeclarations
3505 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
3507 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3508 PyObject* values[4] = {0,0,0,0};
3509 if (unlikely(__pyx_kwds)) {
3511 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3513 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3515 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3517 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3519 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3522 default:
goto __pyx_L5_argtuple_error;
3524 kw_args = PyDict_Size(__pyx_kwds);
3527 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3528 else goto __pyx_L5_argtuple_error;
3531 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3533 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 69, __pyx_L3_error)
3537 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3539 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 69, __pyx_L3_error)
3543 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3545 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 69, __pyx_L3_error)
3548 if (unlikely(kw_args > 0)) {
3549 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 69, __pyx_L3_error)
3551 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3552 goto __pyx_L5_argtuple_error;
3554 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3555 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3556 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3557 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3559 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
3560 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
3561 __pyx_v_ebq_vals = ((PyArrayObject *)values[2]);
3562 __pyx_v_material_functions = ((PyObject*)values[3]);
3564 goto __pyx_L4_argument_unpacking_done;
3565 __pyx_L5_argtuple_error:;
3566 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 69, __pyx_L3_error)
3568 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3569 __Pyx_RefNannyFinishContext();
3571 __pyx_L4_argument_unpacking_done:;
3572 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 69, __pyx_L1_error)
3573 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 70, __pyx_L1_error)
3574 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 71, __pyx_L1_error)
3575 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 72, __pyx_L1_error)
3576 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3583 __Pyx_RefNannyFinishContext();
3587 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3590 int __pyx_v_ebN_local;
3592 int __pyx_v_material_left;
3593 int __pyx_v_material_right;
3594 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3595 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
3596 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3597 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
3598 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3599 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3600 PyObject *__pyx_r = NULL;
3601 __Pyx_RefNannyDeclarations
3608 Py_ssize_t __pyx_t_7;
3609 Py_ssize_t __pyx_t_8;
3611 npy_intp __pyx_t_10;
3612 npy_intp __pyx_t_11;
3613 PyObject *__pyx_t_12 = NULL;
3614 PyObject *__pyx_t_13 = NULL;
3615 PyObject *__pyx_t_14 = NULL;
3616 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
3617 Py_ssize_t __pyx_t_16;
3619 int __pyx_lineno = 0;
3620 const char *__pyx_filename = NULL;
3621 int __pyx_clineno = 0;
3622 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
3623 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
3624 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
3625 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
3626 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
3627 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
3628 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
3629 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
3630 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
3631 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
3632 __pyx_pybuffer_ebq_vals.refcount = 0;
3633 __pyx_pybuffernd_ebq_vals.data = NULL;
3634 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
3636 __Pyx_BufFmt_StackElem __pyx_stack[1];
3637 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3639 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
3641 __Pyx_BufFmt_StackElem __pyx_stack[1];
3642 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3644 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
3646 __Pyx_BufFmt_StackElem __pyx_stack[1];
3647 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3649 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
3658 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
3659 __pyx_t_2 = __pyx_t_1;
3660 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3661 __pyx_v_eN = __pyx_t_3;
3670 __pyx_t_4 = (__pyx_v_ebq_vals->dimensions[1]);
3671 __pyx_t_5 = __pyx_t_4;
3672 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
3673 __pyx_v_ebN_local = __pyx_t_6;
3682 __pyx_t_7 = __pyx_v_eN;
3683 __pyx_t_8 = __pyx_v_ebN_local;
3685 if (__pyx_t_7 < 0) {
3686 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
3687 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
3688 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
3689 if (__pyx_t_8 < 0) {
3690 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
3691 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
3692 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
3693 if (unlikely(__pyx_t_9 != -1)) {
3694 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3695 __PYX_ERR(0, 84, __pyx_L1_error)
3697 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
3706 __pyx_t_8 = __pyx_v_ebN;
3709 if (__pyx_t_8 < 0) {
3710 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3711 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
3712 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
3713 if (__pyx_t_7 < 0) {
3714 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3715 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
3716 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
3717 if (unlikely(__pyx_t_9 != -1)) {
3718 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3719 __PYX_ERR(0, 85, __pyx_L1_error)
3721 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3730 __pyx_t_7 = __pyx_v_ebN;
3733 if (__pyx_t_7 < 0) {
3734 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3735 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
3736 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
3737 if (__pyx_t_8 < 0) {
3738 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3739 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
3740 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
3741 if (unlikely(__pyx_t_9 != -1)) {
3742 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3743 __PYX_ERR(0, 86, __pyx_L1_error)
3745 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3754 __pyx_t_10 = (__pyx_v_ebq_vals->dimensions[2]);
3755 __pyx_t_11 = __pyx_t_10;
3756 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
3757 __pyx_v_k = __pyx_t_9;
3766 if (unlikely(__pyx_v_material_functions == Py_None)) {
3767 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3768 __PYX_ERR(0, 88, __pyx_L1_error)
3770 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error)
3771 __Pyx_GOTREF(__pyx_t_12);
3772 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 88, __pyx_L1_error)
3773 __Pyx_GOTREF(__pyx_t_13);
3774 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3783 if (unlikely(__pyx_v_material_functions == Py_None)) {
3784 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3785 __PYX_ERR(0, 89, __pyx_L1_error)
3787 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 89, __pyx_L1_error)
3788 __Pyx_GOTREF(__pyx_t_12);
3789 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 89, __pyx_L1_error)
3790 __Pyx_GOTREF(__pyx_t_14);
3791 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3800 __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error)
3801 __Pyx_GOTREF(__pyx_t_12);
3802 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3803 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3804 __pyx_t_14 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 88, __pyx_L1_error)
3805 __Pyx_GOTREF(__pyx_t_14);
3806 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3807 __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
3808 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3809 __pyx_t_8 = __pyx_v_eN;
3810 __pyx_t_7 = __pyx_v_ebN_local;
3811 __pyx_t_16 = __pyx_v_k;
3813 if (__pyx_t_8 < 0) {
3814 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
3815 if (unlikely(__pyx_t_8 < 0)) __pyx_t_17 = 0;
3816 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_17 = 0;
3817 if (__pyx_t_7 < 0) {
3818 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
3819 if (unlikely(__pyx_t_7 < 0)) __pyx_t_17 = 1;
3820 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_17 = 1;
3821 if (__pyx_t_16 < 0) {
3822 __pyx_t_16 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
3823 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 2;
3824 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_17 = 2;
3825 if (unlikely(__pyx_t_17 != -1)) {
3826 __Pyx_RaiseBufferIndexError(__pyx_t_17);
3827 __PYX_ERR(0, 88, __pyx_L1_error)
3829 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_15;
3843 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3846 __Pyx_XDECREF(__pyx_t_12);
3847 __Pyx_XDECREF(__pyx_t_13);
3848 __Pyx_XDECREF(__pyx_t_14);
3849 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3850 __Pyx_PyThreadState_declare
3851 __Pyx_PyThreadState_assign
3852 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3853 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3854 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3855 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3856 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3857 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3861 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3862 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3863 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3865 __Pyx_XGIVEREF(__pyx_r);
3866 __Pyx_RefNannyFinishContext();
3879 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3880 static char __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn} f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3881 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
3882 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3884 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3885 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3886 PyArrayObject *__pyx_v_ebq_vals = 0;
3887 PyObject *__pyx_v_material_functions = 0;
3888 int __pyx_lineno = 0;
3889 const char *__pyx_filename = NULL;
3890 int __pyx_clineno = 0;
3891 PyObject *__pyx_r = 0;
3892 __Pyx_RefNannyDeclarations
3893 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
3895 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3896 PyObject* values[5] = {0,0,0,0,0};
3897 if (unlikely(__pyx_kwds)) {
3899 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3901 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3903 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3905 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3907 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3909 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3912 default:
goto __pyx_L5_argtuple_error;
3914 kw_args = PyDict_Size(__pyx_kwds);
3917 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
3918 else goto __pyx_L5_argtuple_error;
3921 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3923 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 91, __pyx_L3_error)
3927 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3929 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 91, __pyx_L3_error)
3933 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3935 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 91, __pyx_L3_error)
3939 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3941 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 91, __pyx_L3_error)
3944 if (unlikely(kw_args > 0)) {
3945 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 91, __pyx_L3_error)
3947 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
3948 goto __pyx_L5_argtuple_error;
3950 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3951 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3952 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3953 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3954 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3956 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
3957 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
3958 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
3959 __pyx_v_ebq_vals = ((PyArrayObject *)values[3]);
3960 __pyx_v_material_functions = ((PyObject*)values[4]);
3962 goto __pyx_L4_argument_unpacking_done;
3963 __pyx_L5_argtuple_error:;
3964 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 91, __pyx_L3_error)
3966 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3967 __Pyx_RefNannyFinishContext();
3969 __pyx_L4_argument_unpacking_done:;
3970 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 92, __pyx_L1_error)
3971 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
3972 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
3973 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 95, __pyx_L1_error)
3974 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3981 __Pyx_RefNannyFinishContext();
3985 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3988 int __pyx_v_ebN_local;
3990 int __pyx_v_material_left;
3991 int __pyx_v_material_right;
3994 double __pyx_v_numer;
3995 double __pyx_v_denom;
3996 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3997 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
3998 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3999 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4000 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4001 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4002 PyObject *__pyx_r = NULL;
4003 __Pyx_RefNannyDeclarations
4010 Py_ssize_t __pyx_t_7;
4011 Py_ssize_t __pyx_t_8;
4013 npy_intp __pyx_t_10;
4014 npy_intp __pyx_t_11;
4021 PyObject *__pyx_t_18 = NULL;
4022 PyObject *__pyx_t_19 = NULL;
4023 PyObject *__pyx_t_20 = NULL;
4024 PyObject *__pyx_t_21 = NULL;
4025 PyObject *__pyx_t_22 = NULL;
4027 Py_ssize_t __pyx_t_24;
4028 Py_ssize_t __pyx_t_25;
4030 int __pyx_lineno = 0;
4031 const char *__pyx_filename = NULL;
4032 int __pyx_clineno = 0;
4033 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
4034 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4035 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4036 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4037 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4038 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4039 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4040 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4041 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4042 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
4043 __pyx_pybuffer_ebq_vals.refcount = 0;
4044 __pyx_pybuffernd_ebq_vals.data = NULL;
4045 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
4047 __Pyx_BufFmt_StackElem __pyx_stack[1];
4048 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4050 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4052 __Pyx_BufFmt_StackElem __pyx_stack[1];
4053 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4055 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4057 __Pyx_BufFmt_StackElem __pyx_stack[1];
4058 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4060 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
4069 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
4070 __pyx_t_2 = __pyx_t_1;
4071 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4072 __pyx_v_eN = __pyx_t_3;
4081 __pyx_t_4 = (__pyx_v_ebq_vals->dimensions[1]);
4082 __pyx_t_5 = __pyx_t_4;
4083 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4084 __pyx_v_ebN_local = __pyx_t_6;
4093 __pyx_t_7 = __pyx_v_eN;
4094 __pyx_t_8 = __pyx_v_ebN_local;
4096 if (__pyx_t_7 < 0) {
4097 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
4098 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
4099 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
4100 if (__pyx_t_8 < 0) {
4101 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
4102 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
4103 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
4104 if (unlikely(__pyx_t_9 != -1)) {
4105 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4106 __PYX_ERR(0, 108, __pyx_L1_error)
4108 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
4117 __pyx_t_8 = __pyx_v_ebN;
4120 if (__pyx_t_8 < 0) {
4121 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4122 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
4123 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
4124 if (__pyx_t_7 < 0) {
4125 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4126 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
4127 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
4128 if (unlikely(__pyx_t_9 != -1)) {
4129 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4130 __PYX_ERR(0, 109, __pyx_L1_error)
4132 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4141 __pyx_t_7 = __pyx_v_ebN;
4144 if (__pyx_t_7 < 0) {
4145 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4146 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
4147 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
4148 if (__pyx_t_8 < 0) {
4149 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4150 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
4151 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
4152 if (unlikely(__pyx_t_9 != -1)) {
4153 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4154 __PYX_ERR(0, 110, __pyx_L1_error)
4156 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4165 __pyx_t_10 = (__pyx_v_ebq_vals->dimensions[2]);
4166 __pyx_t_11 = __pyx_t_10;
4167 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
4168 __pyx_v_k = __pyx_t_9;
4177 __pyx_t_12 = __pyx_v_nd;
4178 __pyx_t_13 = __pyx_t_12;
4179 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
4180 __pyx_v_I = __pyx_t_14;
4189 __pyx_t_15 = __pyx_v_nd;
4190 __pyx_t_16 = __pyx_t_15;
4191 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
4192 __pyx_v_J = __pyx_t_17;
4201 if (unlikely(__pyx_v_material_functions == Py_None)) {
4202 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4203 __PYX_ERR(0, 114, __pyx_L1_error)
4205 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4206 __Pyx_GOTREF(__pyx_t_18);
4207 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 114, __pyx_L1_error)
4208 __Pyx_GOTREF(__pyx_t_19);
4209 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4210 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4211 __Pyx_GOTREF(__pyx_t_18);
4212 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4213 __Pyx_GOTREF(__pyx_t_20);
4214 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 114, __pyx_L1_error)
4215 __Pyx_GOTREF(__pyx_t_21);
4216 __Pyx_GIVEREF(__pyx_t_18);
4217 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_18);
4218 __Pyx_GIVEREF(__pyx_t_20);
4219 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_20);
4222 __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4223 __Pyx_GOTREF(__pyx_t_20);
4224 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4225 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
4226 __pyx_t_21 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 114, __pyx_L1_error)
4227 __Pyx_GOTREF(__pyx_t_21);
4228 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4229 if (unlikely(__pyx_v_material_functions == Py_None)) {
4230 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4231 __PYX_ERR(0, 114, __pyx_L1_error)
4233 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4234 __Pyx_GOTREF(__pyx_t_20);
4235 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_20);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 114, __pyx_L1_error)
4236 __Pyx_GOTREF(__pyx_t_19);
4237 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4238 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4239 __Pyx_GOTREF(__pyx_t_20);
4240 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4241 __Pyx_GOTREF(__pyx_t_18);
4242 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4243 __Pyx_GOTREF(__pyx_t_22);
4244 __Pyx_GIVEREF(__pyx_t_20);
4245 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_20);
4246 __Pyx_GIVEREF(__pyx_t_18);
4247 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_18);
4250 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4251 __Pyx_GOTREF(__pyx_t_18);
4252 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4253 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4254 __pyx_t_22 = PyNumber_Multiply(__pyx_t_21, __pyx_t_18);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4255 __Pyx_GOTREF(__pyx_t_22);
4256 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
4257 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4258 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_22);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
4259 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4260 __pyx_v_numer = __pyx_t_23;
4269 if (unlikely(__pyx_v_material_functions == Py_None)) {
4270 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4271 __PYX_ERR(0, 115, __pyx_L1_error)
4273 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4274 __Pyx_GOTREF(__pyx_t_22);
4275 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
4276 __Pyx_GOTREF(__pyx_t_18);
4277 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4278 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4279 __Pyx_GOTREF(__pyx_t_22);
4280 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
4281 __Pyx_GOTREF(__pyx_t_21);
4282 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
4283 __Pyx_GOTREF(__pyx_t_19);
4284 __Pyx_GIVEREF(__pyx_t_22);
4285 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_22);
4286 __Pyx_GIVEREF(__pyx_t_21);
4287 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_21);
4290 __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_19);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
4291 __Pyx_GOTREF(__pyx_t_21);
4292 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4293 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4294 if (unlikely(__pyx_v_material_functions == Py_None)) {
4295 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4296 __PYX_ERR(0, 115, __pyx_L1_error)
4298 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
4299 __Pyx_GOTREF(__pyx_t_19);
4300 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
4301 __Pyx_GOTREF(__pyx_t_18);
4302 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4303 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
4304 __Pyx_GOTREF(__pyx_t_19);
4305 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4306 __Pyx_GOTREF(__pyx_t_22);
4307 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
4308 __Pyx_GOTREF(__pyx_t_20);
4309 __Pyx_GIVEREF(__pyx_t_19);
4310 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
4311 __Pyx_GIVEREF(__pyx_t_22);
4312 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_22);
4315 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_20);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4316 __Pyx_GOTREF(__pyx_t_22);
4317 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4318 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4319 __pyx_t_20 = PyNumber_Add(__pyx_t_21, __pyx_t_22);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
4320 __Pyx_GOTREF(__pyx_t_20);
4321 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
4322 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4323 __pyx_t_22 = __Pyx_PyFloat_AddObjC(__pyx_t_20, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4324 __Pyx_GOTREF(__pyx_t_22);
4325 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4326 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_22);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error)
4327 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4328 __pyx_v_denom = __pyx_t_23;
4337 if (unlikely(__pyx_v_denom == 0)) {
4338 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
4339 __PYX_ERR(0, 116, __pyx_L1_error)
4341 __pyx_t_8 = __pyx_v_eN;
4342 __pyx_t_7 = __pyx_v_ebN_local;
4343 __pyx_t_24 = __pyx_v_k;
4344 __pyx_t_25 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
4346 if (__pyx_t_8 < 0) {
4347 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
4348 if (unlikely(__pyx_t_8 < 0)) __pyx_t_26 = 0;
4349 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_26 = 0;
4350 if (__pyx_t_7 < 0) {
4351 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
4352 if (unlikely(__pyx_t_7 < 0)) __pyx_t_26 = 1;
4353 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_26 = 1;
4354 if (__pyx_t_24 < 0) {
4355 __pyx_t_24 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
4356 if (unlikely(__pyx_t_24 < 0)) __pyx_t_26 = 2;
4357 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_26 = 2;
4358 if (__pyx_t_25 < 0) {
4359 __pyx_t_25 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
4360 if (unlikely(__pyx_t_25 < 0)) __pyx_t_26 = 3;
4361 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_26 = 3;
4362 if (unlikely(__pyx_t_26 != -1)) {
4363 __Pyx_RaiseBufferIndexError(__pyx_t_26);
4364 __PYX_ERR(0, 116, __pyx_L1_error)
4366 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_25, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
4382 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4385 __Pyx_XDECREF(__pyx_t_18);
4386 __Pyx_XDECREF(__pyx_t_19);
4387 __Pyx_XDECREF(__pyx_t_20);
4388 __Pyx_XDECREF(__pyx_t_21);
4389 __Pyx_XDECREF(__pyx_t_22);
4390 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4391 __Pyx_PyThreadState_declare
4392 __Pyx_PyThreadState_assign
4393 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4394 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4395 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4396 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4397 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4398 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4402 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4403 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4404 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4406 __Pyx_XGIVEREF(__pyx_r);
4407 __Pyx_RefNannyFinishContext();
4420 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4421 static char __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4422 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
4423 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4424 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4425 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4426 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4427 PyObject *__pyx_v_material_functions = 0;
4428 int __pyx_lineno = 0;
4429 const char *__pyx_filename = NULL;
4430 int __pyx_clineno = 0;
4431 PyObject *__pyx_r = 0;
4432 __Pyx_RefNannyDeclarations
4433 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
4435 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4436 PyObject* values[4] = {0,0,0,0};
4437 if (unlikely(__pyx_kwds)) {
4439 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4441 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4443 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4445 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4447 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4450 default:
goto __pyx_L5_argtuple_error;
4452 kw_args = PyDict_Size(__pyx_kwds);
4455 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4456 else goto __pyx_L5_argtuple_error;
4459 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4461 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 118, __pyx_L3_error)
4465 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4467 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 118, __pyx_L3_error)
4471 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4473 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 118, __pyx_L3_error)
4476 if (unlikely(kw_args > 0)) {
4477 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
4479 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4480 goto __pyx_L5_argtuple_error;
4482 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4483 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4484 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4485 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4487 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
4488 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
4489 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[2]);
4490 __pyx_v_material_functions = ((PyObject*)values[3]);
4492 goto __pyx_L4_argument_unpacking_done;
4493 __pyx_L5_argtuple_error:;
4494 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error)
4496 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4497 __Pyx_RefNannyFinishContext();
4499 __pyx_L4_argument_unpacking_done:;
4500 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 118, __pyx_L1_error)
4501 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 119, __pyx_L1_error)
4502 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 120, __pyx_L1_error)
4503 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 121, __pyx_L1_error)
4504 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4511 __Pyx_RefNannyFinishContext();
4515 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4517 int __pyx_v_material_left;
4518 int __pyx_v_material_right;
4520 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4521 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4522 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4523 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4524 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4525 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4526 PyObject *__pyx_r = NULL;
4527 __Pyx_RefNannyDeclarations
4531 Py_ssize_t __pyx_t_4;
4532 Py_ssize_t __pyx_t_5;
4537 PyObject *__pyx_t_10 = NULL;
4538 PyObject *__pyx_t_11 = NULL;
4539 PyObject *__pyx_t_12 = NULL;
4540 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_13;
4541 int __pyx_lineno = 0;
4542 const char *__pyx_filename = NULL;
4543 int __pyx_clineno = 0;
4544 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
4545 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4546 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4547 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4548 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4549 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4550 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4551 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4552 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4553 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4554 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4555 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4556 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4558 __Pyx_BufFmt_StackElem __pyx_stack[1];
4559 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4561 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4563 __Pyx_BufFmt_StackElem __pyx_stack[1];
4564 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4566 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4568 __Pyx_BufFmt_StackElem __pyx_stack[1];
4569 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4571 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
4580 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4581 __pyx_t_2 = __pyx_t_1;
4582 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4583 __pyx_v_ebN = __pyx_t_3;
4592 __pyx_t_4 = __pyx_v_ebN;
4595 if (__pyx_t_4 < 0) {
4596 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4597 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4598 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4599 if (__pyx_t_5 < 0) {
4600 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4601 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4602 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4603 if (unlikely(__pyx_t_6 != -1)) {
4604 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4605 __PYX_ERR(0, 132, __pyx_L1_error)
4607 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4616 __pyx_t_5 = __pyx_v_ebN;
4619 if (__pyx_t_5 < 0) {
4620 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4621 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4622 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4623 if (__pyx_t_4 < 0) {
4624 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4625 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
4626 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4627 if (unlikely(__pyx_t_6 != -1)) {
4628 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4629 __PYX_ERR(0, 133, __pyx_L1_error)
4631 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4640 __pyx_t_7 = (__pyx_v_ebq_global_vals->dimensions[1]);
4641 __pyx_t_8 = __pyx_t_7;
4642 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
4643 __pyx_v_k = __pyx_t_9;
4652 if (unlikely(__pyx_v_material_functions == Py_None)) {
4653 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4654 __PYX_ERR(0, 135, __pyx_L1_error)
4656 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error)
4657 __Pyx_GOTREF(__pyx_t_10);
4658 __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 135, __pyx_L1_error)
4659 __Pyx_GOTREF(__pyx_t_11);
4660 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4669 if (unlikely(__pyx_v_material_functions == Py_None)) {
4670 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4671 __PYX_ERR(0, 136, __pyx_L1_error)
4673 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 136, __pyx_L1_error)
4674 __Pyx_GOTREF(__pyx_t_10);
4675 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 136, __pyx_L1_error)
4676 __Pyx_GOTREF(__pyx_t_12);
4677 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4686 __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error)
4687 __Pyx_GOTREF(__pyx_t_10);
4688 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4689 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4690 __pyx_t_12 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_10);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 135, __pyx_L1_error)
4691 __Pyx_GOTREF(__pyx_t_12);
4692 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4693 __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_12);
if (unlikely((__pyx_t_13 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
4694 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4695 __pyx_t_4 = __pyx_v_ebN;
4696 __pyx_t_5 = __pyx_v_k;
4698 if (__pyx_t_4 < 0) {
4699 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
4700 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4701 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
4702 if (__pyx_t_5 < 0) {
4703 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
4704 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4705 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
4706 if (unlikely(__pyx_t_6 != -1)) {
4707 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4708 __PYX_ERR(0, 135, __pyx_L1_error)
4710 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_13;
4723 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4726 __Pyx_XDECREF(__pyx_t_10);
4727 __Pyx_XDECREF(__pyx_t_11);
4728 __Pyx_XDECREF(__pyx_t_12);
4729 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4730 __Pyx_PyThreadState_declare
4731 __Pyx_PyThreadState_assign
4732 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4733 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4734 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4735 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4736 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4737 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4741 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4742 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4743 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4745 __Pyx_XGIVEREF(__pyx_r);
4746 __Pyx_RefNannyFinishContext();
4759 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4760 static char __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn}f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4761 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
4762 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4764 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4765 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4766 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4767 PyObject *__pyx_v_material_functions = 0;
4768 int __pyx_lineno = 0;
4769 const char *__pyx_filename = NULL;
4770 int __pyx_clineno = 0;
4771 PyObject *__pyx_r = 0;
4772 __Pyx_RefNannyDeclarations
4773 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
4775 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4776 PyObject* values[5] = {0,0,0,0,0};
4777 if (unlikely(__pyx_kwds)) {
4779 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4781 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4783 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4785 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4787 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4789 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4792 default:
goto __pyx_L5_argtuple_error;
4794 kw_args = PyDict_Size(__pyx_kwds);
4797 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4798 else goto __pyx_L5_argtuple_error;
4801 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4803 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 139, __pyx_L3_error)
4807 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4809 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 139, __pyx_L3_error)
4813 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4815 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 139, __pyx_L3_error)
4819 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4821 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 139, __pyx_L3_error)
4824 if (unlikely(kw_args > 0)) {
4825 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 139, __pyx_L3_error)
4827 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4828 goto __pyx_L5_argtuple_error;
4830 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4831 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4832 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4833 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4834 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4836 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error)
4837 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
4838 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
4839 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[3]);
4840 __pyx_v_material_functions = ((PyObject*)values[4]);
4842 goto __pyx_L4_argument_unpacking_done;
4843 __pyx_L5_argtuple_error:;
4844 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 139, __pyx_L3_error)
4846 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4847 __Pyx_RefNannyFinishContext();
4849 __pyx_L4_argument_unpacking_done:;
4850 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 140, __pyx_L1_error)
4851 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 141, __pyx_L1_error)
4852 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 142, __pyx_L1_error)
4853 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 143, __pyx_L1_error)
4854 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4861 __Pyx_RefNannyFinishContext();
4865 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4868 int __pyx_v_material_left;
4869 int __pyx_v_material_right;
4872 double __pyx_v_numer;
4873 double __pyx_v_denom;
4874 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4875 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4876 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4877 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4878 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4879 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4880 PyObject *__pyx_r = NULL;
4881 __Pyx_RefNannyDeclarations
4885 Py_ssize_t __pyx_t_4;
4886 Py_ssize_t __pyx_t_5;
4896 PyObject *__pyx_t_15 = NULL;
4897 PyObject *__pyx_t_16 = NULL;
4898 PyObject *__pyx_t_17 = NULL;
4899 PyObject *__pyx_t_18 = NULL;
4900 PyObject *__pyx_t_19 = NULL;
4902 Py_ssize_t __pyx_t_21;
4904 int __pyx_lineno = 0;
4905 const char *__pyx_filename = NULL;
4906 int __pyx_clineno = 0;
4907 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
4908 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4909 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4910 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4911 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4912 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4913 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4914 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4915 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4916 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4917 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4918 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4919 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4921 __Pyx_BufFmt_StackElem __pyx_stack[1];
4922 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4924 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4926 __Pyx_BufFmt_StackElem __pyx_stack[1];
4927 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4929 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4931 __Pyx_BufFmt_StackElem __pyx_stack[1];
4932 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4934 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
4943 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4944 __pyx_t_2 = __pyx_t_1;
4945 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4946 __pyx_v_ebN = __pyx_t_3;
4955 __pyx_t_4 = __pyx_v_ebN;
4958 if (__pyx_t_4 < 0) {
4959 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4960 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4961 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4962 if (__pyx_t_5 < 0) {
4963 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4964 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4965 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4966 if (unlikely(__pyx_t_6 != -1)) {
4967 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4968 __PYX_ERR(0, 155, __pyx_L1_error)
4970 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4979 __pyx_t_5 = __pyx_v_ebN;
4982 if (__pyx_t_5 < 0) {
4983 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4984 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4985 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4986 if (__pyx_t_4 < 0) {
4987 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4988 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
4989 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4990 if (unlikely(__pyx_t_6 != -1)) {
4991 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4992 __PYX_ERR(0, 156, __pyx_L1_error)
4994 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
5003 __pyx_t_7 = (__pyx_v_ebq_global_vals->dimensions[1]);
5004 __pyx_t_8 = __pyx_t_7;
5005 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) {
5006 __pyx_v_k = __pyx_t_6;
5015 __pyx_t_9 = __pyx_v_nd;
5016 __pyx_t_10 = __pyx_t_9;
5017 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5018 __pyx_v_I = __pyx_t_11;
5027 __pyx_t_12 = __pyx_v_nd;
5028 __pyx_t_13 = __pyx_t_12;
5029 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5030 __pyx_v_J = __pyx_t_14;
5039 if (unlikely(__pyx_v_material_functions == Py_None)) {
5040 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5041 __PYX_ERR(0, 160, __pyx_L1_error)
5043 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5044 __Pyx_GOTREF(__pyx_t_15);
5045 __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 160, __pyx_L1_error)
5046 __Pyx_GOTREF(__pyx_t_16);
5047 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5048 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5049 __Pyx_GOTREF(__pyx_t_15);
5050 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5051 __Pyx_GOTREF(__pyx_t_17);
5052 __pyx_t_18 = PyTuple_New(2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 160, __pyx_L1_error)
5053 __Pyx_GOTREF(__pyx_t_18);
5054 __Pyx_GIVEREF(__pyx_t_15);
5055 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_15);
5056 __Pyx_GIVEREF(__pyx_t_17);
5057 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_17);
5060 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_18);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5061 __Pyx_GOTREF(__pyx_t_17);
5062 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5063 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5064 __pyx_t_18 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 160, __pyx_L1_error)
5065 __Pyx_GOTREF(__pyx_t_18);
5066 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5067 if (unlikely(__pyx_v_material_functions == Py_None)) {
5068 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5069 __PYX_ERR(0, 160, __pyx_L1_error)
5071 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5072 __Pyx_GOTREF(__pyx_t_17);
5073 __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 160, __pyx_L1_error)
5074 __Pyx_GOTREF(__pyx_t_16);
5075 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5076 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5077 __Pyx_GOTREF(__pyx_t_17);
5078 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5079 __Pyx_GOTREF(__pyx_t_15);
5080 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
5081 __Pyx_GOTREF(__pyx_t_19);
5082 __Pyx_GIVEREF(__pyx_t_17);
5083 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17);
5084 __Pyx_GIVEREF(__pyx_t_15);
5085 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_15);
5088 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_19);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5089 __Pyx_GOTREF(__pyx_t_15);
5090 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5091 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5092 __pyx_t_19 = PyNumber_Multiply(__pyx_t_18, __pyx_t_15);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
5093 __Pyx_GOTREF(__pyx_t_19);
5094 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5095 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5096 __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_19);
if (unlikely((__pyx_t_20 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
5097 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5098 __pyx_v_numer = __pyx_t_20;
5107 if (unlikely(__pyx_v_material_functions == Py_None)) {
5108 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5109 __PYX_ERR(0, 161, __pyx_L1_error)
5111 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5112 __Pyx_GOTREF(__pyx_t_19);
5113 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
5114 __Pyx_GOTREF(__pyx_t_15);
5115 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5116 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5117 __Pyx_GOTREF(__pyx_t_19);
5118 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5119 __Pyx_GOTREF(__pyx_t_18);
5120 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
5121 __Pyx_GOTREF(__pyx_t_16);
5122 __Pyx_GIVEREF(__pyx_t_19);
5123 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_19);
5124 __Pyx_GIVEREF(__pyx_t_18);
5125 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_18);
5128 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5129 __Pyx_GOTREF(__pyx_t_18);
5130 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5131 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5132 if (unlikely(__pyx_v_material_functions == Py_None)) {
5133 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5134 __PYX_ERR(0, 161, __pyx_L1_error)
5136 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
5137 __Pyx_GOTREF(__pyx_t_16);
5138 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
5139 __Pyx_GOTREF(__pyx_t_15);
5140 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5141 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
5142 __Pyx_GOTREF(__pyx_t_16);
5143 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5144 __Pyx_GOTREF(__pyx_t_19);
5145 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
5146 __Pyx_GOTREF(__pyx_t_17);
5147 __Pyx_GIVEREF(__pyx_t_16);
5148 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16);
5149 __Pyx_GIVEREF(__pyx_t_19);
5150 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_19);
5153 __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_17);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5154 __Pyx_GOTREF(__pyx_t_19);
5155 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5156 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5157 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_t_19);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
5158 __Pyx_GOTREF(__pyx_t_17);
5159 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5160 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5161 __pyx_t_19 = __Pyx_PyFloat_AddObjC(__pyx_t_17, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5162 __Pyx_GOTREF(__pyx_t_19);
5163 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5164 __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_19);
if (unlikely((__pyx_t_20 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
5165 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5166 __pyx_v_denom = __pyx_t_20;
5175 if (unlikely(__pyx_v_denom == 0)) {
5176 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
5177 __PYX_ERR(0, 162, __pyx_L1_error)
5179 __pyx_t_4 = __pyx_v_ebN;
5180 __pyx_t_5 = __pyx_v_k;
5181 __pyx_t_21 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
5183 if (__pyx_t_4 < 0) {
5184 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
5185 if (unlikely(__pyx_t_4 < 0)) __pyx_t_22 = 0;
5186 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_22 = 0;
5187 if (__pyx_t_5 < 0) {
5188 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
5189 if (unlikely(__pyx_t_5 < 0)) __pyx_t_22 = 1;
5190 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_22 = 1;
5191 if (__pyx_t_21 < 0) {
5192 __pyx_t_21 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
5193 if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 2;
5194 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_22 = 2;
5195 if (unlikely(__pyx_t_22 != -1)) {
5196 __Pyx_RaiseBufferIndexError(__pyx_t_22);
5197 __PYX_ERR(0, 162, __pyx_L1_error)
5199 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
5214 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5217 __Pyx_XDECREF(__pyx_t_15);
5218 __Pyx_XDECREF(__pyx_t_16);
5219 __Pyx_XDECREF(__pyx_t_17);
5220 __Pyx_XDECREF(__pyx_t_18);
5221 __Pyx_XDECREF(__pyx_t_19);
5222 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5223 __Pyx_PyThreadState_declare
5224 __Pyx_PyThreadState_assign
5225 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5226 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
5227 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5228 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5229 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5230 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
5234 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
5235 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5236 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5238 __Pyx_XGIVEREF(__pyx_r);
5239 __Pyx_RefNannyFinishContext();
5252 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5253 static char __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function f_j(x,t) assuming element is material j\n likely little improvement right now without correct typing of material_functions\n ";
5254 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements = {
"evaluateScalarMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements};
5255 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5257 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
5258 PyArrayObject *__pyx_v_x = 0;
5259 PyArrayObject *__pyx_v_q_vals = 0;
5260 PyObject *__pyx_v_material_functions = 0;
5261 int __pyx_lineno = 0;
5262 const char *__pyx_filename = NULL;
5263 int __pyx_clineno = 0;
5264 PyObject *__pyx_r = 0;
5265 __Pyx_RefNannyDeclarations
5266 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements (wrapper)", 0);
5268 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
5269 PyObject* values[5] = {0,0,0,0,0};
5270 if (unlikely(__pyx_kwds)) {
5272 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5274 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5276 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5278 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5280 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5282 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5285 default:
goto __pyx_L5_argtuple_error;
5287 kw_args = PyDict_Size(__pyx_kwds);
5290 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5291 else goto __pyx_L5_argtuple_error;
5294 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
5296 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 165, __pyx_L3_error)
5300 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5302 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 165, __pyx_L3_error)
5306 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
5308 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 165, __pyx_L3_error)
5312 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5314 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 165, __pyx_L3_error)
5317 if (unlikely(kw_args > 0)) {
5318 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
5320 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5321 goto __pyx_L5_argtuple_error;
5323 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5324 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5325 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5326 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5327 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5329 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L3_error)
5330 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5331 __pyx_v_x = ((PyArrayObject *)values[2]);
5332 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5333 __pyx_v_material_functions = ((PyObject*)values[4]);
5335 goto __pyx_L4_argument_unpacking_done;
5336 __pyx_L5_argtuple_error:;
5337 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
5339 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5340 __Pyx_RefNannyFinishContext();
5342 __pyx_L4_argument_unpacking_done:;
5343 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 166, __pyx_L1_error)
5344 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 167, __pyx_L1_error)
5345 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 168, __pyx_L1_error)
5346 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 169, __pyx_L1_error)
5347 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5354 __Pyx_RefNannyFinishContext();
5358 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5361 int __pyx_v_material;
5362 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5363 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5364 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5365 __Pyx_Buffer __pyx_pybuffer_q_vals;
5366 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5367 __Pyx_Buffer __pyx_pybuffer_x;
5368 PyObject *__pyx_r = NULL;
5369 __Pyx_RefNannyDeclarations
5373 Py_ssize_t __pyx_t_4;
5377 PyObject *__pyx_t_8 = NULL;
5378 PyObject *__pyx_t_9 = NULL;
5379 PyObject *__pyx_t_10 = NULL;
5380 PyObject *__pyx_t_11 = NULL;
5381 PyObject *__pyx_t_12 = NULL;
5383 PyObject *__pyx_t_14 = NULL;
5384 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
5385 Py_ssize_t __pyx_t_16;
5386 int __pyx_lineno = 0;
5387 const char *__pyx_filename = NULL;
5388 int __pyx_clineno = 0;
5389 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements", 0);
5390 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5391 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5392 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5393 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5394 __pyx_pybuffer_x.pybuffer.buf = NULL;
5395 __pyx_pybuffer_x.refcount = 0;
5396 __pyx_pybuffernd_x.data = NULL;
5397 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5398 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5399 __pyx_pybuffer_q_vals.refcount = 0;
5400 __pyx_pybuffernd_q_vals.data = NULL;
5401 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5403 __Pyx_BufFmt_StackElem __pyx_stack[1];
5404 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5406 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5408 __Pyx_BufFmt_StackElem __pyx_stack[1];
5409 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5411 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5413 __Pyx_BufFmt_StackElem __pyx_stack[1];
5414 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5416 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
5425 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5426 __pyx_t_2 = __pyx_t_1;
5427 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5428 __pyx_v_eN = __pyx_t_3;
5437 __pyx_t_4 = __pyx_v_eN;
5439 if (__pyx_t_4 < 0) {
5440 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5441 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
5442 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
5443 if (unlikely(__pyx_t_5 != -1)) {
5444 __Pyx_RaiseBufferIndexError(__pyx_t_5);
5445 __PYX_ERR(0, 176, __pyx_L1_error)
5447 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5456 __pyx_t_6 = (__pyx_v_x->dimensions[1]);
5457 __pyx_t_7 = __pyx_t_6;
5458 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
5459 __pyx_v_k = __pyx_t_5;
5468 if (unlikely(__pyx_v_material_functions == Py_None)) {
5469 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5470 __PYX_ERR(0, 178, __pyx_L1_error)
5472 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5473 __Pyx_GOTREF(__pyx_t_9);
5474 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 178, __pyx_L1_error)
5475 __Pyx_GOTREF(__pyx_t_10);
5476 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5477 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5478 __Pyx_GOTREF(__pyx_t_9);
5479 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error)
5480 __Pyx_GOTREF(__pyx_t_11);
5481 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error)
5482 __Pyx_GOTREF(__pyx_t_12);
5483 __Pyx_GIVEREF(__pyx_t_9);
5484 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
5485 __Pyx_GIVEREF(__pyx_t_11);
5486 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
5489 __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_12);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error)
5490 __Pyx_GOTREF(__pyx_t_11);
5491 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5492 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error)
5493 __Pyx_GOTREF(__pyx_t_12);
5496 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
5497 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
5498 if (likely(__pyx_t_9)) {
5499 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
5500 __Pyx_INCREF(__pyx_t_9);
5501 __Pyx_INCREF(
function);
5502 __Pyx_DECREF_SET(__pyx_t_10,
function);
5506 #if CYTHON_FAST_PYCALL
5507 if (PyFunction_Check(__pyx_t_10)) {
5508 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5509 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5510 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5511 __Pyx_GOTREF(__pyx_t_8);
5512 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5513 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5516 #if CYTHON_FAST_PYCCALL
5517 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
5518 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5519 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5520 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5521 __Pyx_GOTREF(__pyx_t_8);
5522 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5523 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5527 __pyx_t_14 = PyTuple_New(2+__pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 178, __pyx_L1_error)
5528 __Pyx_GOTREF(__pyx_t_14);
5530 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL;
5532 __Pyx_GIVEREF(__pyx_t_11);
5533 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_11);
5534 __Pyx_GIVEREF(__pyx_t_12);
5535 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_12);
5538 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5539 __Pyx_GOTREF(__pyx_t_8);
5540 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5542 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5543 __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_8);
if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
5544 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5545 __pyx_t_4 = __pyx_v_eN;
5546 __pyx_t_16 = __pyx_v_k;
5548 if (__pyx_t_4 < 0) {
5549 __pyx_t_4 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
5550 if (unlikely(__pyx_t_4 < 0)) __pyx_t_13 = 0;
5551 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_13 = 0;
5552 if (__pyx_t_16 < 0) {
5553 __pyx_t_16 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
5554 if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 1;
5555 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_13 = 1;
5556 if (unlikely(__pyx_t_13 != -1)) {
5557 __Pyx_RaiseBufferIndexError(__pyx_t_13);
5558 __PYX_ERR(0, 178, __pyx_L1_error)
5560 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_15;
5573 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5576 __Pyx_XDECREF(__pyx_t_8);
5577 __Pyx_XDECREF(__pyx_t_9);
5578 __Pyx_XDECREF(__pyx_t_10);
5579 __Pyx_XDECREF(__pyx_t_11);
5580 __Pyx_XDECREF(__pyx_t_12);
5581 __Pyx_XDECREF(__pyx_t_14);
5582 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5583 __Pyx_PyThreadState_declare
5584 __Pyx_PyThreadState_assign
5585 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5586 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5587 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5588 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5589 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5590 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5594 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5595 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5596 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5598 __Pyx_XGIVEREF(__pyx_r);
5599 __Pyx_RefNannyFinishContext();
5612 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5613 static char __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function \013ec f_j(x,t) assuming element is material j\n ";
5614 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements = {
"evaluateVectorMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements};
5615 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5617 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
5618 PyArrayObject *__pyx_v_x = 0;
5619 PyArrayObject *__pyx_v_q_vals = 0;
5620 PyObject *__pyx_v_material_functions = 0;
5621 int __pyx_lineno = 0;
5622 const char *__pyx_filename = NULL;
5623 int __pyx_clineno = 0;
5624 PyObject *__pyx_r = 0;
5625 __Pyx_RefNannyDeclarations
5626 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements (wrapper)", 0);
5628 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
5629 PyObject* values[5] = {0,0,0,0,0};
5630 if (unlikely(__pyx_kwds)) {
5632 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5634 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5636 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5638 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5640 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5642 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5645 default:
goto __pyx_L5_argtuple_error;
5647 kw_args = PyDict_Size(__pyx_kwds);
5650 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5651 else goto __pyx_L5_argtuple_error;
5654 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
5656 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 180, __pyx_L3_error)
5660 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5662 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 180, __pyx_L3_error)
5666 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
5668 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 180, __pyx_L3_error)
5672 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5674 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 180, __pyx_L3_error)
5677 if (unlikely(kw_args > 0)) {
5678 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 180, __pyx_L3_error)
5680 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5681 goto __pyx_L5_argtuple_error;
5683 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5684 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5685 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5686 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5687 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5689 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error)
5690 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5691 __pyx_v_x = ((PyArrayObject *)values[2]);
5692 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5693 __pyx_v_material_functions = ((PyObject*)values[4]);
5695 goto __pyx_L4_argument_unpacking_done;
5696 __pyx_L5_argtuple_error:;
5697 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error)
5699 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5700 __Pyx_RefNannyFinishContext();
5702 __pyx_L4_argument_unpacking_done:;
5703 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 181, __pyx_L1_error)
5704 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 182, __pyx_L1_error)
5705 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
5706 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 184, __pyx_L1_error)
5707 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5714 __Pyx_RefNannyFinishContext();
5718 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5721 int __pyx_v_material;
5722 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5723 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5724 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5725 __Pyx_Buffer __pyx_pybuffer_q_vals;
5726 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5727 __Pyx_Buffer __pyx_pybuffer_x;
5728 PyObject *__pyx_r = NULL;
5729 __Pyx_RefNannyDeclarations
5733 Py_ssize_t __pyx_t_4;
5737 PyObject *__pyx_t_8 = NULL;
5738 PyObject *__pyx_t_9 = NULL;
5739 PyObject *__pyx_t_10 = NULL;
5740 PyObject *__pyx_t_11 = NULL;
5741 PyObject *__pyx_t_12 = NULL;
5743 PyObject *__pyx_t_14 = NULL;
5744 int __pyx_lineno = 0;
5745 const char *__pyx_filename = NULL;
5746 int __pyx_clineno = 0;
5747 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements", 0);
5748 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5749 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5750 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5751 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5752 __pyx_pybuffer_x.pybuffer.buf = NULL;
5753 __pyx_pybuffer_x.refcount = 0;
5754 __pyx_pybuffernd_x.data = NULL;
5755 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5756 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5757 __pyx_pybuffer_q_vals.refcount = 0;
5758 __pyx_pybuffernd_q_vals.data = NULL;
5759 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5761 __Pyx_BufFmt_StackElem __pyx_stack[1];
5762 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5764 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5766 __Pyx_BufFmt_StackElem __pyx_stack[1];
5767 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5769 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5771 __Pyx_BufFmt_StackElem __pyx_stack[1];
5772 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5774 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
5783 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5784 __pyx_t_2 = __pyx_t_1;
5785 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5786 __pyx_v_eN = __pyx_t_3;
5795 __pyx_t_4 = __pyx_v_eN;
5797 if (__pyx_t_4 < 0) {
5798 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5799 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
5800 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
5801 if (unlikely(__pyx_t_5 != -1)) {
5802 __Pyx_RaiseBufferIndexError(__pyx_t_5);
5803 __PYX_ERR(0, 190, __pyx_L1_error)
5805 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5814 __pyx_t_6 = (__pyx_v_x->dimensions[1]);
5815 __pyx_t_7 = __pyx_t_6;
5816 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
5817 __pyx_v_k = __pyx_t_5;
5826 if (unlikely(__pyx_v_material_functions == Py_None)) {
5827 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5828 __PYX_ERR(0, 192, __pyx_L1_error)
5830 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5831 __Pyx_GOTREF(__pyx_t_9);
5832 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5833 __Pyx_GOTREF(__pyx_t_10);
5834 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5835 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5836 __Pyx_GOTREF(__pyx_t_9);
5837 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L1_error)
5838 __Pyx_GOTREF(__pyx_t_11);
5839 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5840 __Pyx_GOTREF(__pyx_t_12);
5841 __Pyx_GIVEREF(__pyx_t_9);
5842 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
5843 __Pyx_GIVEREF(__pyx_t_11);
5844 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
5847 __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_12);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L1_error)
5848 __Pyx_GOTREF(__pyx_t_11);
5849 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5850 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5851 __Pyx_GOTREF(__pyx_t_12);
5854 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
5855 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
5856 if (likely(__pyx_t_9)) {
5857 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
5858 __Pyx_INCREF(__pyx_t_9);
5859 __Pyx_INCREF(
function);
5860 __Pyx_DECREF_SET(__pyx_t_10,
function);
5864 #if CYTHON_FAST_PYCALL
5865 if (PyFunction_Check(__pyx_t_10)) {
5866 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5867 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5868 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5869 __Pyx_GOTREF(__pyx_t_8);
5870 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5871 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5874 #if CYTHON_FAST_PYCCALL
5875 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
5876 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5877 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5878 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5879 __Pyx_GOTREF(__pyx_t_8);
5880 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5881 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5885 __pyx_t_14 = PyTuple_New(2+__pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 192, __pyx_L1_error)
5886 __Pyx_GOTREF(__pyx_t_14);
5888 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL;
5890 __Pyx_GIVEREF(__pyx_t_11);
5891 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_11);
5892 __Pyx_GIVEREF(__pyx_t_12);
5893 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_12);
5896 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5897 __Pyx_GOTREF(__pyx_t_8);
5898 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5900 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5901 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flat);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5902 __Pyx_GOTREF(__pyx_t_10);
5903 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5904 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5905 __Pyx_GOTREF(__pyx_t_8);
5906 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 192, __pyx_L1_error)
5907 __Pyx_GOTREF(__pyx_t_14);
5908 __pyx_t_12 = PyTuple_New(3);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5909 __Pyx_GOTREF(__pyx_t_12);
5910 __Pyx_GIVEREF(__pyx_t_8);
5911 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8);
5912 __Pyx_GIVEREF(__pyx_t_14);
5913 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14);
5914 __Pyx_INCREF(__pyx_slice_);
5915 __Pyx_GIVEREF(__pyx_slice_);
5916 PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_slice_);
5919 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_12, __pyx_t_10) < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
5920 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5921 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5934 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5937 __Pyx_XDECREF(__pyx_t_8);
5938 __Pyx_XDECREF(__pyx_t_9);
5939 __Pyx_XDECREF(__pyx_t_10);
5940 __Pyx_XDECREF(__pyx_t_11);
5941 __Pyx_XDECREF(__pyx_t_12);
5942 __Pyx_XDECREF(__pyx_t_14);
5943 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5944 __Pyx_PyThreadState_declare
5945 __Pyx_PyThreadState_assign
5946 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5947 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5948 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5949 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5950 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5951 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5955 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5956 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5957 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5959 __Pyx_XGIVEREF(__pyx_r);
5960 __Pyx_RefNannyFinishContext();
5973 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5974 static char __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
5975 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
5976 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5978 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
5979 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
5980 PyArrayObject *__pyx_v_x = 0;
5981 PyArrayObject *__pyx_v_ebq_vals = 0;
5982 PyObject *__pyx_v_material_functions = 0;
5983 int __pyx_lineno = 0;
5984 const char *__pyx_filename = NULL;
5985 int __pyx_clineno = 0;
5986 PyObject *__pyx_r = 0;
5987 __Pyx_RefNannyDeclarations
5988 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
5990 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
5991 PyObject* values[6] = {0,0,0,0,0,0};
5992 if (unlikely(__pyx_kwds)) {
5994 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5996 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5998 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6000 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6002 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6004 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6006 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6009 default:
goto __pyx_L5_argtuple_error;
6011 kw_args = PyDict_Size(__pyx_kwds);
6014 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6015 else goto __pyx_L5_argtuple_error;
6018 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
6020 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 195, __pyx_L3_error)
6024 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
6026 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 195, __pyx_L3_error)
6030 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6032 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 195, __pyx_L3_error)
6036 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
6038 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 195, __pyx_L3_error)
6042 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
6044 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 195, __pyx_L3_error)
6047 if (unlikely(kw_args > 0)) {
6048 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 195, __pyx_L3_error)
6050 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6051 goto __pyx_L5_argtuple_error;
6053 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6054 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6055 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6056 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6057 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6058 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6060 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
6061 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
6062 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
6063 __pyx_v_x = ((PyArrayObject *)values[3]);
6064 __pyx_v_ebq_vals = ((PyArrayObject *)values[4]);
6065 __pyx_v_material_functions = ((PyObject*)values[5]);
6067 goto __pyx_L4_argument_unpacking_done;
6068 __pyx_L5_argtuple_error:;
6069 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error)
6071 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6072 __Pyx_RefNannyFinishContext();
6074 __pyx_L4_argument_unpacking_done:;
6075 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 196, __pyx_L1_error)
6076 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
6077 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
6078 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
6079 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 200, __pyx_L1_error)
6080 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
6087 __Pyx_RefNannyFinishContext();
6091 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
6094 int __pyx_v_ebN_local;
6096 int __pyx_v_material_left;
6097 int __pyx_v_material_right;
6098 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
6099 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
6100 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
6101 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
6102 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
6103 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
6104 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
6105 __Pyx_Buffer __pyx_pybuffer_x;
6106 PyObject *__pyx_r = NULL;
6107 __Pyx_RefNannyDeclarations
6114 Py_ssize_t __pyx_t_7;
6115 Py_ssize_t __pyx_t_8;
6117 npy_intp __pyx_t_10;
6118 npy_intp __pyx_t_11;
6119 PyObject *__pyx_t_12 = NULL;
6120 PyObject *__pyx_t_13 = NULL;
6121 PyObject *__pyx_t_14 = NULL;
6122 PyObject *__pyx_t_15 = NULL;
6123 PyObject *__pyx_t_16 = NULL;
6124 PyObject *__pyx_t_17 = NULL;
6126 PyObject *__pyx_t_19 = NULL;
6127 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_20;
6128 Py_ssize_t __pyx_t_21;
6129 int __pyx_lineno = 0;
6130 const char *__pyx_filename = NULL;
6131 int __pyx_clineno = 0;
6132 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
6133 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6134 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6135 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6136 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6137 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6138 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6139 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6140 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6141 __pyx_pybuffer_x.pybuffer.buf = NULL;
6142 __pyx_pybuffer_x.refcount = 0;
6143 __pyx_pybuffernd_x.data = NULL;
6144 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6145 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
6146 __pyx_pybuffer_ebq_vals.refcount = 0;
6147 __pyx_pybuffernd_ebq_vals.data = NULL;
6148 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
6150 __Pyx_BufFmt_StackElem __pyx_stack[1];
6151 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6153 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6155 __Pyx_BufFmt_StackElem __pyx_stack[1];
6156 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6158 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6160 __Pyx_BufFmt_StackElem __pyx_stack[1];
6161 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6163 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
6165 __Pyx_BufFmt_StackElem __pyx_stack[1];
6166 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6168 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
6177 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6178 __pyx_t_2 = __pyx_t_1;
6179 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6180 __pyx_v_eN = __pyx_t_3;
6189 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
6190 __pyx_t_5 = __pyx_t_4;
6191 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6192 __pyx_v_ebN_local = __pyx_t_6;
6201 __pyx_t_7 = __pyx_v_eN;
6202 __pyx_t_8 = __pyx_v_ebN_local;
6204 if (__pyx_t_7 < 0) {
6205 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6206 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6207 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
6208 if (__pyx_t_8 < 0) {
6209 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6210 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6211 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
6212 if (unlikely(__pyx_t_9 != -1)) {
6213 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6214 __PYX_ERR(0, 212, __pyx_L1_error)
6216 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6225 __pyx_t_8 = __pyx_v_ebN;
6228 if (__pyx_t_8 < 0) {
6229 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6230 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
6231 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6232 if (__pyx_t_7 < 0) {
6233 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6234 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
6235 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6236 if (unlikely(__pyx_t_9 != -1)) {
6237 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6238 __PYX_ERR(0, 213, __pyx_L1_error)
6240 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6249 __pyx_t_7 = __pyx_v_ebN;
6252 if (__pyx_t_7 < 0) {
6253 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6254 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6255 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6256 if (__pyx_t_8 < 0) {
6257 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6258 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6259 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6260 if (unlikely(__pyx_t_9 != -1)) {
6261 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6262 __PYX_ERR(0, 214, __pyx_L1_error)
6264 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6273 __pyx_t_10 = (__pyx_v_x->dimensions[2]);
6274 __pyx_t_11 = __pyx_t_10;
6275 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
6276 __pyx_v_k = __pyx_t_9;
6285 if (unlikely(__pyx_v_material_functions == Py_None)) {
6286 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6287 __PYX_ERR(0, 216, __pyx_L1_error)
6289 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
6290 __Pyx_GOTREF(__pyx_t_13);
6291 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 216, __pyx_L1_error)
6292 __Pyx_GOTREF(__pyx_t_14);
6293 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6294 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
6295 __Pyx_GOTREF(__pyx_t_13);
6296 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 216, __pyx_L1_error)
6297 __Pyx_GOTREF(__pyx_t_15);
6298 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6299 __Pyx_GOTREF(__pyx_t_16);
6300 __pyx_t_17 = PyTuple_New(3);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6301 __Pyx_GOTREF(__pyx_t_17);
6302 __Pyx_GIVEREF(__pyx_t_13);
6303 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_13);
6304 __Pyx_GIVEREF(__pyx_t_15);
6305 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_15);
6306 __Pyx_GIVEREF(__pyx_t_16);
6307 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_16);
6311 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6312 __Pyx_GOTREF(__pyx_t_16);
6313 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6314 __pyx_t_17 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6315 __Pyx_GOTREF(__pyx_t_17);
6318 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
6319 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
6320 if (likely(__pyx_t_15)) {
6321 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
6322 __Pyx_INCREF(__pyx_t_15);
6323 __Pyx_INCREF(
function);
6324 __Pyx_DECREF_SET(__pyx_t_14,
function);
6328 #if CYTHON_FAST_PYCALL
6329 if (PyFunction_Check(__pyx_t_14)) {
6330 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_16, __pyx_t_17};
6331 __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 216, __pyx_L1_error)
6332 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6333 __Pyx_GOTREF(__pyx_t_12);
6334 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6335 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6338 #if CYTHON_FAST_PYCCALL
6339 if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
6340 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_16, __pyx_t_17};
6341 __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 216, __pyx_L1_error)
6342 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6343 __Pyx_GOTREF(__pyx_t_12);
6344 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6345 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6349 __pyx_t_13 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
6350 __Pyx_GOTREF(__pyx_t_13);
6352 __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_15); __pyx_t_15 = NULL;
6354 __Pyx_GIVEREF(__pyx_t_16);
6355 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_18, __pyx_t_16);
6356 __Pyx_GIVEREF(__pyx_t_17);
6357 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_18, __pyx_t_17);
6360 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_13, NULL);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 216, __pyx_L1_error)
6361 __Pyx_GOTREF(__pyx_t_12);
6362 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6364 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6373 if (unlikely(__pyx_v_material_functions == Py_None)) {
6374 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6375 __PYX_ERR(0, 217, __pyx_L1_error)
6377 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 217, __pyx_L1_error)
6378 __Pyx_GOTREF(__pyx_t_13);
6379 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
6380 __Pyx_GOTREF(__pyx_t_17);
6381 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6382 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 217, __pyx_L1_error)
6383 __Pyx_GOTREF(__pyx_t_13);
6384 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 217, __pyx_L1_error)
6385 __Pyx_GOTREF(__pyx_t_16);
6386 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 217, __pyx_L1_error)
6387 __Pyx_GOTREF(__pyx_t_15);
6388 __pyx_t_19 = PyTuple_New(3);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 217, __pyx_L1_error)
6389 __Pyx_GOTREF(__pyx_t_19);
6390 __Pyx_GIVEREF(__pyx_t_13);
6391 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_13);
6392 __Pyx_GIVEREF(__pyx_t_16);
6393 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_16);
6394 __Pyx_GIVEREF(__pyx_t_15);
6395 PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_15);
6399 __pyx_t_15 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_19);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 217, __pyx_L1_error)
6400 __Pyx_GOTREF(__pyx_t_15);
6401 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6402 __pyx_t_19 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 217, __pyx_L1_error)
6403 __Pyx_GOTREF(__pyx_t_19);
6406 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
6407 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17);
6408 if (likely(__pyx_t_16)) {
6409 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
6410 __Pyx_INCREF(__pyx_t_16);
6411 __Pyx_INCREF(
function);
6412 __Pyx_DECREF_SET(__pyx_t_17,
function);
6416 #if CYTHON_FAST_PYCALL
6417 if (PyFunction_Check(__pyx_t_17)) {
6418 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_15, __pyx_t_19};
6419 __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
6420 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6421 __Pyx_GOTREF(__pyx_t_14);
6422 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6423 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6426 #if CYTHON_FAST_PYCCALL
6427 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
6428 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_15, __pyx_t_19};
6429 __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
6430 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6431 __Pyx_GOTREF(__pyx_t_14);
6432 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6433 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6437 __pyx_t_13 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 217, __pyx_L1_error)
6438 __Pyx_GOTREF(__pyx_t_13);
6440 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_16); __pyx_t_16 = NULL;
6442 __Pyx_GIVEREF(__pyx_t_15);
6443 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_18, __pyx_t_15);
6444 __Pyx_GIVEREF(__pyx_t_19);
6445 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_18, __pyx_t_19);
6448 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_13, NULL);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
6449 __Pyx_GOTREF(__pyx_t_14);
6450 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6452 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6461 __pyx_t_17 = PyNumber_Add(__pyx_t_12, __pyx_t_14);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6462 __Pyx_GOTREF(__pyx_t_17);
6463 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6464 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6465 __pyx_t_14 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_17);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 216, __pyx_L1_error)
6466 __Pyx_GOTREF(__pyx_t_14);
6467 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6468 __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_20 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error)
6469 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6470 __pyx_t_8 = __pyx_v_eN;
6471 __pyx_t_7 = __pyx_v_ebN_local;
6472 __pyx_t_21 = __pyx_v_k;
6474 if (__pyx_t_8 < 0) {
6475 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
6476 if (unlikely(__pyx_t_8 < 0)) __pyx_t_18 = 0;
6477 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_18 = 0;
6478 if (__pyx_t_7 < 0) {
6479 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
6480 if (unlikely(__pyx_t_7 < 0)) __pyx_t_18 = 1;
6481 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_18 = 1;
6482 if (__pyx_t_21 < 0) {
6483 __pyx_t_21 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
6484 if (unlikely(__pyx_t_21 < 0)) __pyx_t_18 = 2;
6485 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_18 = 2;
6486 if (unlikely(__pyx_t_18 != -1)) {
6487 __Pyx_RaiseBufferIndexError(__pyx_t_18);
6488 __PYX_ERR(0, 216, __pyx_L1_error)
6490 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_20;
6504 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6507 __Pyx_XDECREF(__pyx_t_12);
6508 __Pyx_XDECREF(__pyx_t_13);
6509 __Pyx_XDECREF(__pyx_t_14);
6510 __Pyx_XDECREF(__pyx_t_15);
6511 __Pyx_XDECREF(__pyx_t_16);
6512 __Pyx_XDECREF(__pyx_t_17);
6513 __Pyx_XDECREF(__pyx_t_19);
6514 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6515 __Pyx_PyThreadState_declare
6516 __Pyx_PyThreadState_assign
6517 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6518 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6519 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6520 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6521 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6522 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6523 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6527 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6528 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6529 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6530 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6532 __Pyx_XGIVEREF(__pyx_r);
6533 __Pyx_RefNannyFinishContext();
6546 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6547 static char __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
6548 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
6549 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6552 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
6553 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
6554 PyArrayObject *__pyx_v_x = 0;
6555 PyArrayObject *__pyx_v_ebq_vals = 0;
6556 PyObject *__pyx_v_material_functions = 0;
6557 int __pyx_lineno = 0;
6558 const char *__pyx_filename = NULL;
6559 int __pyx_clineno = 0;
6560 PyObject *__pyx_r = 0;
6561 __Pyx_RefNannyDeclarations
6562 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
6564 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
6565 PyObject* values[7] = {0,0,0,0,0,0,0};
6566 if (unlikely(__pyx_kwds)) {
6568 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6570 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6572 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6574 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6576 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6578 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6580 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6582 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6585 default:
goto __pyx_L5_argtuple_error;
6587 kw_args = PyDict_Size(__pyx_kwds);
6590 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
6591 else goto __pyx_L5_argtuple_error;
6594 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6596 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 219, __pyx_L3_error)
6600 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
6602 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 219, __pyx_L3_error)
6606 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
6608 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 219, __pyx_L3_error)
6612 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6614 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 219, __pyx_L3_error)
6618 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
6620 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 219, __pyx_L3_error)
6624 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
6626 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 219, __pyx_L3_error)
6629 if (unlikely(kw_args > 0)) {
6630 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
6632 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
6633 goto __pyx_L5_argtuple_error;
6635 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6636 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6637 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6638 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6639 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6640 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6641 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6643 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L3_error)
6644 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L3_error)
6645 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
6646 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
6647 __pyx_v_x = ((PyArrayObject *)values[4]);
6648 __pyx_v_ebq_vals = ((PyArrayObject *)values[5]);
6649 __pyx_v_material_functions = ((PyObject*)values[6]);
6651 goto __pyx_L4_argument_unpacking_done;
6652 __pyx_L5_argtuple_error:;
6653 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
6655 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6656 __Pyx_RefNannyFinishContext();
6658 __pyx_L4_argument_unpacking_done:;
6659 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 221, __pyx_L1_error)
6660 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 222, __pyx_L1_error)
6661 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 223, __pyx_L1_error)
6662 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 224, __pyx_L1_error)
6663 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 225, __pyx_L1_error)
6664 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
6671 __Pyx_RefNannyFinishContext();
6675 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
6678 int __pyx_v_ebN_local;
6680 int __pyx_v_material_left;
6681 int __pyx_v_material_right;
6684 double __pyx_v_numer;
6685 double __pyx_v_denom;
6686 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
6687 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
6688 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
6689 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
6690 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
6691 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
6692 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
6693 __Pyx_Buffer __pyx_pybuffer_x;
6694 PyObject *__pyx_r = NULL;
6695 __Pyx_RefNannyDeclarations
6702 Py_ssize_t __pyx_t_7;
6703 Py_ssize_t __pyx_t_8;
6705 npy_intp __pyx_t_10;
6706 npy_intp __pyx_t_11;
6713 PyObject *__pyx_t_18 = NULL;
6714 PyObject *__pyx_t_19 = NULL;
6715 PyObject *__pyx_t_20 = NULL;
6716 PyObject *__pyx_t_21 = NULL;
6717 PyObject *__pyx_t_22 = NULL;
6718 PyObject *__pyx_t_23 = NULL;
6720 PyObject *__pyx_t_25 = NULL;
6722 Py_ssize_t __pyx_t_27;
6723 Py_ssize_t __pyx_t_28;
6724 int __pyx_lineno = 0;
6725 const char *__pyx_filename = NULL;
6726 int __pyx_clineno = 0;
6727 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
6728 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6729 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6730 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6731 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6732 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6733 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6734 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6735 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6736 __pyx_pybuffer_x.pybuffer.buf = NULL;
6737 __pyx_pybuffer_x.refcount = 0;
6738 __pyx_pybuffernd_x.data = NULL;
6739 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6740 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
6741 __pyx_pybuffer_ebq_vals.refcount = 0;
6742 __pyx_pybuffernd_ebq_vals.data = NULL;
6743 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
6745 __Pyx_BufFmt_StackElem __pyx_stack[1];
6746 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6748 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6750 __Pyx_BufFmt_StackElem __pyx_stack[1];
6751 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6753 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6755 __Pyx_BufFmt_StackElem __pyx_stack[1];
6756 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6758 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
6760 __Pyx_BufFmt_StackElem __pyx_stack[1];
6761 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6763 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
6772 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6773 __pyx_t_2 = __pyx_t_1;
6774 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6775 __pyx_v_eN = __pyx_t_3;
6784 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
6785 __pyx_t_5 = __pyx_t_4;
6786 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6787 __pyx_v_ebN_local = __pyx_t_6;
6796 __pyx_t_7 = __pyx_v_eN;
6797 __pyx_t_8 = __pyx_v_ebN_local;
6799 if (__pyx_t_7 < 0) {
6800 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6801 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6802 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
6803 if (__pyx_t_8 < 0) {
6804 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6805 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6806 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
6807 if (unlikely(__pyx_t_9 != -1)) {
6808 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6809 __PYX_ERR(0, 238, __pyx_L1_error)
6811 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6820 __pyx_t_8 = __pyx_v_ebN;
6823 if (__pyx_t_8 < 0) {
6824 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6825 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
6826 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6827 if (__pyx_t_7 < 0) {
6828 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6829 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
6830 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6831 if (unlikely(__pyx_t_9 != -1)) {
6832 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6833 __PYX_ERR(0, 239, __pyx_L1_error)
6835 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6844 __pyx_t_7 = __pyx_v_ebN;
6847 if (__pyx_t_7 < 0) {
6848 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6849 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6850 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6851 if (__pyx_t_8 < 0) {
6852 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6853 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6854 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6855 if (unlikely(__pyx_t_9 != -1)) {
6856 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6857 __PYX_ERR(0, 240, __pyx_L1_error)
6859 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6868 __pyx_t_10 = (__pyx_v_x->dimensions[2]);
6869 __pyx_t_11 = __pyx_t_10;
6870 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
6871 __pyx_v_k = __pyx_t_9;
6880 __pyx_t_12 = __pyx_v_nd;
6881 __pyx_t_13 = __pyx_t_12;
6882 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
6883 __pyx_v_I = __pyx_t_14;
6892 __pyx_t_15 = __pyx_v_nd;
6893 __pyx_t_16 = __pyx_t_15;
6894 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
6895 __pyx_v_J = __pyx_t_17;
6904 if (unlikely(__pyx_v_material_functions == Py_None)) {
6905 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6906 __PYX_ERR(0, 244, __pyx_L1_error)
6908 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6909 __Pyx_GOTREF(__pyx_t_19);
6910 __pyx_t_20 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
6911 __Pyx_GOTREF(__pyx_t_20);
6912 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6913 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6914 __Pyx_GOTREF(__pyx_t_19);
6915 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
6916 __Pyx_GOTREF(__pyx_t_21);
6917 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6918 __Pyx_GOTREF(__pyx_t_22);
6919 __pyx_t_23 = PyTuple_New(3);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6920 __Pyx_GOTREF(__pyx_t_23);
6921 __Pyx_GIVEREF(__pyx_t_19);
6922 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_19);
6923 __Pyx_GIVEREF(__pyx_t_21);
6924 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21);
6925 __Pyx_GIVEREF(__pyx_t_22);
6926 PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_22);
6930 __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_23);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6931 __Pyx_GOTREF(__pyx_t_22);
6932 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6933 __pyx_t_23 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6934 __Pyx_GOTREF(__pyx_t_23);
6937 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
6938 __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_20);
6939 if (likely(__pyx_t_21)) {
6940 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_20);
6941 __Pyx_INCREF(__pyx_t_21);
6942 __Pyx_INCREF(
function);
6943 __Pyx_DECREF_SET(__pyx_t_20,
function);
6947 #if CYTHON_FAST_PYCALL
6948 if (PyFunction_Check(__pyx_t_20)) {
6949 PyObject *__pyx_temp[3] = {__pyx_t_21, __pyx_t_22, __pyx_t_23};
6950 __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6951 __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
6952 __Pyx_GOTREF(__pyx_t_18);
6953 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6954 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6957 #if CYTHON_FAST_PYCCALL
6958 if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
6959 PyObject *__pyx_temp[3] = {__pyx_t_21, __pyx_t_22, __pyx_t_23};
6960 __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6961 __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
6962 __Pyx_GOTREF(__pyx_t_18);
6963 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6964 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6968 __pyx_t_19 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6969 __Pyx_GOTREF(__pyx_t_19);
6971 __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_21); __pyx_t_21 = NULL;
6973 __Pyx_GIVEREF(__pyx_t_22);
6974 PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_24, __pyx_t_22);
6975 __Pyx_GIVEREF(__pyx_t_23);
6976 PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_24, __pyx_t_23);
6979 __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, NULL);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6980 __Pyx_GOTREF(__pyx_t_18);
6981 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6983 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6984 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
6985 __Pyx_GOTREF(__pyx_t_20);
6986 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6987 __Pyx_GOTREF(__pyx_t_19);
6988 __pyx_t_23 = PyTuple_New(2);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6989 __Pyx_GOTREF(__pyx_t_23);
6990 __Pyx_GIVEREF(__pyx_t_20);
6991 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20);
6992 __Pyx_GIVEREF(__pyx_t_19);
6993 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_19);
6996 __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_23);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6997 __Pyx_GOTREF(__pyx_t_19);
6998 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6999 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7000 __pyx_t_23 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_19);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
7001 __Pyx_GOTREF(__pyx_t_23);
7002 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7003 if (unlikely(__pyx_v_material_functions == Py_None)) {
7004 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7005 __PYX_ERR(0, 244, __pyx_L1_error)
7007 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7008 __Pyx_GOTREF(__pyx_t_18);
7009 __pyx_t_20 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
7010 __Pyx_GOTREF(__pyx_t_20);
7011 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7012 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7013 __Pyx_GOTREF(__pyx_t_18);
7014 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
7015 __Pyx_GOTREF(__pyx_t_22);
7016 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
7017 __Pyx_GOTREF(__pyx_t_21);
7018 __pyx_t_25 = PyTuple_New(3);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7019 __Pyx_GOTREF(__pyx_t_25);
7020 __Pyx_GIVEREF(__pyx_t_18);
7021 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_18);
7022 __Pyx_GIVEREF(__pyx_t_22);
7023 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_22);
7024 __Pyx_GIVEREF(__pyx_t_21);
7025 PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_21);
7029 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_25);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
7030 __Pyx_GOTREF(__pyx_t_21);
7031 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7032 __pyx_t_25 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7033 __Pyx_GOTREF(__pyx_t_25);
7036 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
7037 __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_20);
7038 if (likely(__pyx_t_22)) {
7039 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_20);
7040 __Pyx_INCREF(__pyx_t_22);
7041 __Pyx_INCREF(
function);
7042 __Pyx_DECREF_SET(__pyx_t_20,
function);
7046 #if CYTHON_FAST_PYCALL
7047 if (PyFunction_Check(__pyx_t_20)) {
7048 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_25};
7049 __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7050 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
7051 __Pyx_GOTREF(__pyx_t_19);
7052 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7053 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7056 #if CYTHON_FAST_PYCCALL
7057 if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
7058 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_25};
7059 __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7060 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
7061 __Pyx_GOTREF(__pyx_t_19);
7062 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7063 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7067 __pyx_t_18 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7068 __Pyx_GOTREF(__pyx_t_18);
7070 __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_22); __pyx_t_22 = NULL;
7072 __Pyx_GIVEREF(__pyx_t_21);
7073 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_24, __pyx_t_21);
7074 __Pyx_GIVEREF(__pyx_t_25);
7075 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_24, __pyx_t_25);
7078 __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7079 __Pyx_GOTREF(__pyx_t_19);
7080 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7082 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7083 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
7084 __Pyx_GOTREF(__pyx_t_20);
7085 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7086 __Pyx_GOTREF(__pyx_t_18);
7087 __pyx_t_25 = PyTuple_New(2);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7088 __Pyx_GOTREF(__pyx_t_25);
7089 __Pyx_GIVEREF(__pyx_t_20);
7090 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_20);
7091 __Pyx_GIVEREF(__pyx_t_18);
7092 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_18);
7095 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_25);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7096 __Pyx_GOTREF(__pyx_t_18);
7097 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7098 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7099 __pyx_t_25 = PyNumber_Multiply(__pyx_t_23, __pyx_t_18);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7100 __Pyx_GOTREF(__pyx_t_25);
7101 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7102 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7103 __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_25);
if (unlikely((__pyx_t_26 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error)
7104 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7105 __pyx_v_numer = __pyx_t_26;
7114 if (unlikely(__pyx_v_material_functions == Py_None)) {
7115 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7116 __PYX_ERR(0, 245, __pyx_L1_error)
7118 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7119 __Pyx_GOTREF(__pyx_t_18);
7120 __pyx_t_23 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7121 __Pyx_GOTREF(__pyx_t_23);
7122 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7123 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7124 __Pyx_GOTREF(__pyx_t_18);
7125 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
7126 __Pyx_GOTREF(__pyx_t_19);
7127 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
7128 __Pyx_GOTREF(__pyx_t_20);
7129 __pyx_t_21 = PyTuple_New(3);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7130 __Pyx_GOTREF(__pyx_t_21);
7131 __Pyx_GIVEREF(__pyx_t_18);
7132 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_18);
7133 __Pyx_GIVEREF(__pyx_t_19);
7134 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_19);
7135 __Pyx_GIVEREF(__pyx_t_20);
7136 PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_t_20);
7140 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
7141 __Pyx_GOTREF(__pyx_t_20);
7142 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7143 __pyx_t_21 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7144 __Pyx_GOTREF(__pyx_t_21);
7147 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
7148 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_23);
7149 if (likely(__pyx_t_19)) {
7150 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_23);
7151 __Pyx_INCREF(__pyx_t_19);
7152 __Pyx_INCREF(
function);
7153 __Pyx_DECREF_SET(__pyx_t_23,
function);
7157 #if CYTHON_FAST_PYCALL
7158 if (PyFunction_Check(__pyx_t_23)) {
7159 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_20, __pyx_t_21};
7160 __pyx_t_25 = __Pyx_PyFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7161 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
7162 __Pyx_GOTREF(__pyx_t_25);
7163 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7164 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7167 #if CYTHON_FAST_PYCCALL
7168 if (__Pyx_PyFastCFunction_Check(__pyx_t_23)) {
7169 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_20, __pyx_t_21};
7170 __pyx_t_25 = __Pyx_PyCFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7171 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
7172 __Pyx_GOTREF(__pyx_t_25);
7173 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7174 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7178 __pyx_t_18 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7179 __Pyx_GOTREF(__pyx_t_18);
7181 __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_19); __pyx_t_19 = NULL;
7183 __Pyx_GIVEREF(__pyx_t_20);
7184 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_24, __pyx_t_20);
7185 __Pyx_GIVEREF(__pyx_t_21);
7186 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_24, __pyx_t_21);
7189 __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7190 __Pyx_GOTREF(__pyx_t_25);
7191 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7193 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7194 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7195 __Pyx_GOTREF(__pyx_t_23);
7196 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7197 __Pyx_GOTREF(__pyx_t_18);
7198 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7199 __Pyx_GOTREF(__pyx_t_21);
7200 __Pyx_GIVEREF(__pyx_t_23);
7201 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_23);
7202 __Pyx_GIVEREF(__pyx_t_18);
7203 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_18);
7206 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_25, __pyx_t_21);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7207 __Pyx_GOTREF(__pyx_t_18);
7208 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7209 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7210 if (unlikely(__pyx_v_material_functions == Py_None)) {
7211 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7212 __PYX_ERR(0, 245, __pyx_L1_error)
7214 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7215 __Pyx_GOTREF(__pyx_t_25);
7216 __pyx_t_23 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_25);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7217 __Pyx_GOTREF(__pyx_t_23);
7218 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7219 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7220 __Pyx_GOTREF(__pyx_t_25);
7221 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
7222 __Pyx_GOTREF(__pyx_t_20);
7223 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
7224 __Pyx_GOTREF(__pyx_t_19);
7225 __pyx_t_22 = PyTuple_New(3);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7226 __Pyx_GOTREF(__pyx_t_22);
7227 __Pyx_GIVEREF(__pyx_t_25);
7228 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_25);
7229 __Pyx_GIVEREF(__pyx_t_20);
7230 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_20);
7231 __Pyx_GIVEREF(__pyx_t_19);
7232 PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_19);
7236 __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_22);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
7237 __Pyx_GOTREF(__pyx_t_19);
7238 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7239 __pyx_t_22 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7240 __Pyx_GOTREF(__pyx_t_22);
7243 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
7244 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_23);
7245 if (likely(__pyx_t_20)) {
7246 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_23);
7247 __Pyx_INCREF(__pyx_t_20);
7248 __Pyx_INCREF(
function);
7249 __Pyx_DECREF_SET(__pyx_t_23,
function);
7253 #if CYTHON_FAST_PYCALL
7254 if (PyFunction_Check(__pyx_t_23)) {
7255 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_22};
7256 __pyx_t_21 = __Pyx_PyFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7257 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
7258 __Pyx_GOTREF(__pyx_t_21);
7259 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7260 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7263 #if CYTHON_FAST_PYCCALL
7264 if (__Pyx_PyFastCFunction_Check(__pyx_t_23)) {
7265 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_22};
7266 __pyx_t_21 = __Pyx_PyCFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7267 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
7268 __Pyx_GOTREF(__pyx_t_21);
7269 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7270 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7274 __pyx_t_25 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7275 __Pyx_GOTREF(__pyx_t_25);
7277 __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_20); __pyx_t_20 = NULL;
7279 __Pyx_GIVEREF(__pyx_t_19);
7280 PyTuple_SET_ITEM(__pyx_t_25, 0+__pyx_t_24, __pyx_t_19);
7281 __Pyx_GIVEREF(__pyx_t_22);
7282 PyTuple_SET_ITEM(__pyx_t_25, 1+__pyx_t_24, __pyx_t_22);
7285 __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_25, NULL);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7286 __Pyx_GOTREF(__pyx_t_21);
7287 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7289 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7290 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7291 __Pyx_GOTREF(__pyx_t_23);
7292 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7293 __Pyx_GOTREF(__pyx_t_25);
7294 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7295 __Pyx_GOTREF(__pyx_t_22);
7296 __Pyx_GIVEREF(__pyx_t_23);
7297 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_23);
7298 __Pyx_GIVEREF(__pyx_t_25);
7299 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_25);
7302 __pyx_t_25 = __Pyx_PyObject_GetItem(__pyx_t_21, __pyx_t_22);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7303 __Pyx_GOTREF(__pyx_t_25);
7304 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7305 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7306 __pyx_t_22 = PyNumber_Add(__pyx_t_18, __pyx_t_25);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7307 __Pyx_GOTREF(__pyx_t_22);
7308 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7309 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7310 __pyx_t_25 = __Pyx_PyFloat_AddObjC(__pyx_t_22, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7311 __Pyx_GOTREF(__pyx_t_25);
7312 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7313 __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_25);
if (unlikely((__pyx_t_26 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error)
7314 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7315 __pyx_v_denom = __pyx_t_26;
7324 if (unlikely(__pyx_v_denom == 0)) {
7325 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
7326 __PYX_ERR(0, 246, __pyx_L1_error)
7328 __pyx_t_8 = __pyx_v_eN;
7329 __pyx_t_7 = __pyx_v_ebN_local;
7330 __pyx_t_27 = __pyx_v_k;
7331 __pyx_t_28 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
7333 if (__pyx_t_8 < 0) {
7334 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
7335 if (unlikely(__pyx_t_8 < 0)) __pyx_t_24 = 0;
7336 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_24 = 0;
7337 if (__pyx_t_7 < 0) {
7338 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
7339 if (unlikely(__pyx_t_7 < 0)) __pyx_t_24 = 1;
7340 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_24 = 1;
7341 if (__pyx_t_27 < 0) {
7342 __pyx_t_27 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
7343 if (unlikely(__pyx_t_27 < 0)) __pyx_t_24 = 2;
7344 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_24 = 2;
7345 if (__pyx_t_28 < 0) {
7346 __pyx_t_28 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
7347 if (unlikely(__pyx_t_28 < 0)) __pyx_t_24 = 3;
7348 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_24 = 3;
7349 if (unlikely(__pyx_t_24 != -1)) {
7350 __Pyx_RaiseBufferIndexError(__pyx_t_24);
7351 __PYX_ERR(0, 246, __pyx_L1_error)
7353 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_28, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
7369 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7372 __Pyx_XDECREF(__pyx_t_18);
7373 __Pyx_XDECREF(__pyx_t_19);
7374 __Pyx_XDECREF(__pyx_t_20);
7375 __Pyx_XDECREF(__pyx_t_21);
7376 __Pyx_XDECREF(__pyx_t_22);
7377 __Pyx_XDECREF(__pyx_t_23);
7378 __Pyx_XDECREF(__pyx_t_25);
7379 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7380 __Pyx_PyThreadState_declare
7381 __Pyx_PyThreadState_assign
7382 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7383 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
7384 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7385 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7386 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7387 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7388 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7392 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
7393 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7394 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7395 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7397 __Pyx_XGIVEREF(__pyx_r);
7398 __Pyx_RefNannyFinishContext();
7411 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7412 static char __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
7413 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
7414 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7416 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7417 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7418 PyArrayObject *__pyx_v_x = 0;
7419 PyArrayObject *__pyx_v_ebq_global_vals = 0;
7420 PyObject *__pyx_v_material_functions = 0;
7421 int __pyx_lineno = 0;
7422 const char *__pyx_filename = NULL;
7423 int __pyx_clineno = 0;
7424 PyObject *__pyx_r = 0;
7425 __Pyx_RefNannyDeclarations
7426 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
7428 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
7429 PyObject* values[6] = {0,0,0,0,0,0};
7430 if (unlikely(__pyx_kwds)) {
7432 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7434 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7436 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7438 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7440 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7442 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7444 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7447 default:
goto __pyx_L5_argtuple_error;
7449 kw_args = PyDict_Size(__pyx_kwds);
7452 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7453 else goto __pyx_L5_argtuple_error;
7456 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
7458 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 248, __pyx_L3_error)
7462 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
7464 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 248, __pyx_L3_error)
7468 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7470 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 248, __pyx_L3_error)
7474 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
7476 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 248, __pyx_L3_error)
7480 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
7482 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 248, __pyx_L3_error)
7485 if (unlikely(kw_args > 0)) {
7486 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
7488 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
7489 goto __pyx_L5_argtuple_error;
7491 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7492 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7493 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7494 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7495 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7496 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7498 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error)
7499 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
7500 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
7501 __pyx_v_x = ((PyArrayObject *)values[3]);
7502 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[4]);
7503 __pyx_v_material_functions = ((PyObject*)values[5]);
7505 goto __pyx_L4_argument_unpacking_done;
7506 __pyx_L5_argtuple_error:;
7507 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error)
7509 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7510 __Pyx_RefNannyFinishContext();
7512 __pyx_L4_argument_unpacking_done:;
7513 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 249, __pyx_L1_error)
7514 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 250, __pyx_L1_error)
7515 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 251, __pyx_L1_error)
7516 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 252, __pyx_L1_error)
7517 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 253, __pyx_L1_error)
7518 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
7525 __Pyx_RefNannyFinishContext();
7529 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
7531 int __pyx_v_material_left;
7532 int __pyx_v_material_right;
7534 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
7535 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
7536 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
7537 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
7538 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
7539 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
7540 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
7541 __Pyx_Buffer __pyx_pybuffer_x;
7542 PyObject *__pyx_r = NULL;
7543 __Pyx_RefNannyDeclarations
7547 Py_ssize_t __pyx_t_4;
7548 Py_ssize_t __pyx_t_5;
7553 PyObject *__pyx_t_10 = NULL;
7554 PyObject *__pyx_t_11 = NULL;
7555 PyObject *__pyx_t_12 = NULL;
7556 PyObject *__pyx_t_13 = NULL;
7557 PyObject *__pyx_t_14 = NULL;
7558 PyObject *__pyx_t_15 = NULL;
7559 PyObject *__pyx_t_16 = NULL;
7560 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_17;
7561 int __pyx_lineno = 0;
7562 const char *__pyx_filename = NULL;
7563 int __pyx_clineno = 0;
7564 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
7565 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
7566 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
7567 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
7568 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
7569 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
7570 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
7571 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
7572 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
7573 __pyx_pybuffer_x.pybuffer.buf = NULL;
7574 __pyx_pybuffer_x.refcount = 0;
7575 __pyx_pybuffernd_x.data = NULL;
7576 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
7577 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
7578 __pyx_pybuffer_ebq_global_vals.refcount = 0;
7579 __pyx_pybuffernd_ebq_global_vals.data = NULL;
7580 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
7582 __Pyx_BufFmt_StackElem __pyx_stack[1];
7583 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7585 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
7587 __Pyx_BufFmt_StackElem __pyx_stack[1];
7588 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7590 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
7592 __Pyx_BufFmt_StackElem __pyx_stack[1];
7593 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7595 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
7597 __Pyx_BufFmt_StackElem __pyx_stack[1];
7598 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7600 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
7609 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
7610 __pyx_t_2 = __pyx_t_1;
7611 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
7612 __pyx_v_ebN = __pyx_t_3;
7621 __pyx_t_4 = __pyx_v_ebN;
7624 if (__pyx_t_4 < 0) {
7625 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7626 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
7627 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7628 if (__pyx_t_5 < 0) {
7629 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7630 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
7631 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7632 if (unlikely(__pyx_t_6 != -1)) {
7633 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7634 __PYX_ERR(0, 264, __pyx_L1_error)
7636 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7645 __pyx_t_5 = __pyx_v_ebN;
7648 if (__pyx_t_5 < 0) {
7649 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7650 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
7651 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7652 if (__pyx_t_4 < 0) {
7653 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7654 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
7655 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7656 if (unlikely(__pyx_t_6 != -1)) {
7657 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7658 __PYX_ERR(0, 265, __pyx_L1_error)
7660 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7669 __pyx_t_7 = (__pyx_v_x->dimensions[1]);
7670 __pyx_t_8 = __pyx_t_7;
7671 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
7672 __pyx_v_k = __pyx_t_9;
7681 if (unlikely(__pyx_v_material_functions == Py_None)) {
7682 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7683 __PYX_ERR(0, 267, __pyx_L1_error)
7685 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 267, __pyx_L1_error)
7686 __Pyx_GOTREF(__pyx_t_11);
7687 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_11);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7688 __Pyx_GOTREF(__pyx_t_12);
7689 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7690 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 267, __pyx_L1_error)
7691 __Pyx_GOTREF(__pyx_t_11);
7692 __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7693 __Pyx_GOTREF(__pyx_t_13);
7694 __pyx_t_14 = PyTuple_New(2);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7695 __Pyx_GOTREF(__pyx_t_14);
7696 __Pyx_GIVEREF(__pyx_t_11);
7697 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
7698 __Pyx_GIVEREF(__pyx_t_13);
7699 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_13);
7702 __pyx_t_13 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_14);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7703 __Pyx_GOTREF(__pyx_t_13);
7704 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7705 __pyx_t_14 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7706 __Pyx_GOTREF(__pyx_t_14);
7709 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
7710 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
7711 if (likely(__pyx_t_11)) {
7712 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_12);
7713 __Pyx_INCREF(__pyx_t_11);
7714 __Pyx_INCREF(
function);
7715 __Pyx_DECREF_SET(__pyx_t_12,
function);
7719 #if CYTHON_FAST_PYCALL
7720 if (PyFunction_Check(__pyx_t_12)) {
7721 PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_13, __pyx_t_14};
7722 __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7723 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7724 __Pyx_GOTREF(__pyx_t_10);
7725 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7726 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7729 #if CYTHON_FAST_PYCCALL
7730 if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
7731 PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_13, __pyx_t_14};
7732 __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7733 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7734 __Pyx_GOTREF(__pyx_t_10);
7735 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7736 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7740 __pyx_t_15 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 267, __pyx_L1_error)
7741 __Pyx_GOTREF(__pyx_t_15);
7743 __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_11); __pyx_t_11 = NULL;
7745 __Pyx_GIVEREF(__pyx_t_13);
7746 PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_6, __pyx_t_13);
7747 __Pyx_GIVEREF(__pyx_t_14);
7748 PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_6, __pyx_t_14);
7751 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7752 __Pyx_GOTREF(__pyx_t_10);
7753 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7755 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7764 if (unlikely(__pyx_v_material_functions == Py_None)) {
7765 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7766 __PYX_ERR(0, 268, __pyx_L1_error)
7768 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7769 __Pyx_GOTREF(__pyx_t_15);
7770 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
7771 __Pyx_GOTREF(__pyx_t_14);
7772 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7773 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7774 __Pyx_GOTREF(__pyx_t_15);
7775 __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7776 __Pyx_GOTREF(__pyx_t_13);
7777 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 268, __pyx_L1_error)
7778 __Pyx_GOTREF(__pyx_t_11);
7779 __Pyx_GIVEREF(__pyx_t_15);
7780 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_15);
7781 __Pyx_GIVEREF(__pyx_t_13);
7782 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
7785 __pyx_t_13 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_11);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7786 __Pyx_GOTREF(__pyx_t_13);
7787 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7788 __pyx_t_11 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 268, __pyx_L1_error)
7789 __Pyx_GOTREF(__pyx_t_11);
7792 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
7793 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
7794 if (likely(__pyx_t_15)) {
7795 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
7796 __Pyx_INCREF(__pyx_t_15);
7797 __Pyx_INCREF(
function);
7798 __Pyx_DECREF_SET(__pyx_t_14,
function);
7802 #if CYTHON_FAST_PYCALL
7803 if (PyFunction_Check(__pyx_t_14)) {
7804 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_11};
7805 __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7806 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
7807 __Pyx_GOTREF(__pyx_t_12);
7808 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7809 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7812 #if CYTHON_FAST_PYCCALL
7813 if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
7814 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_11};
7815 __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7816 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
7817 __Pyx_GOTREF(__pyx_t_12);
7818 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7819 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7823 __pyx_t_16 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 268, __pyx_L1_error)
7824 __Pyx_GOTREF(__pyx_t_16);
7826 __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
7828 __Pyx_GIVEREF(__pyx_t_13);
7829 PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_6, __pyx_t_13);
7830 __Pyx_GIVEREF(__pyx_t_11);
7831 PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_11);
7834 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7835 __Pyx_GOTREF(__pyx_t_12);
7836 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7838 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7847 __pyx_t_14 = PyNumber_Add(__pyx_t_10, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7848 __Pyx_GOTREF(__pyx_t_14);
7849 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7850 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7851 __pyx_t_12 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_14);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7852 __Pyx_GOTREF(__pyx_t_12);
7853 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7854 __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_12);
if (unlikely((__pyx_t_17 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error)
7855 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7856 __pyx_t_4 = __pyx_v_ebN;
7857 __pyx_t_5 = __pyx_v_k;
7859 if (__pyx_t_4 < 0) {
7860 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
7861 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
7862 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
7863 if (__pyx_t_5 < 0) {
7864 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
7865 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
7866 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
7867 if (unlikely(__pyx_t_6 != -1)) {
7868 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7869 __PYX_ERR(0, 267, __pyx_L1_error)
7871 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_17;
7884 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7887 __Pyx_XDECREF(__pyx_t_10);
7888 __Pyx_XDECREF(__pyx_t_11);
7889 __Pyx_XDECREF(__pyx_t_12);
7890 __Pyx_XDECREF(__pyx_t_13);
7891 __Pyx_XDECREF(__pyx_t_14);
7892 __Pyx_XDECREF(__pyx_t_15);
7893 __Pyx_XDECREF(__pyx_t_16);
7894 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7895 __Pyx_PyThreadState_declare
7896 __Pyx_PyThreadState_assign
7897 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7898 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7899 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7900 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7901 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7902 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7903 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7907 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7908 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7909 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7910 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7912 __Pyx_XGIVEREF(__pyx_r);
7913 __Pyx_RefNannyFinishContext();
7926 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7927 static char __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
7928 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
7929 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7932 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7933 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7934 PyArrayObject *__pyx_v_x = 0;
7935 PyArrayObject *__pyx_v_ebq_global_vals = 0;
7936 PyObject *__pyx_v_material_functions = 0;
7937 int __pyx_lineno = 0;
7938 const char *__pyx_filename = NULL;
7939 int __pyx_clineno = 0;
7940 PyObject *__pyx_r = 0;
7941 __Pyx_RefNannyDeclarations
7942 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
7944 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
7945 PyObject* values[7] = {0,0,0,0,0,0,0};
7946 if (unlikely(__pyx_kwds)) {
7948 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7950 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7952 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7954 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7956 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7958 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7960 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7962 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7965 default:
goto __pyx_L5_argtuple_error;
7967 kw_args = PyDict_Size(__pyx_kwds);
7970 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
7971 else goto __pyx_L5_argtuple_error;
7974 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7976 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 271, __pyx_L3_error)
7980 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
7982 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 271, __pyx_L3_error)
7986 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
7988 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 271, __pyx_L3_error)
7992 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7994 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 271, __pyx_L3_error)
7998 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
8000 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 271, __pyx_L3_error)
8004 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
8006 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 271, __pyx_L3_error)
8009 if (unlikely(kw_args > 0)) {
8010 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 271, __pyx_L3_error)
8012 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
8013 goto __pyx_L5_argtuple_error;
8015 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8016 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8017 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8018 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8019 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8020 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8021 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8023 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error)
8024 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error)
8025 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
8026 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
8027 __pyx_v_x = ((PyArrayObject *)values[4]);
8028 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[5]);
8029 __pyx_v_material_functions = ((PyObject*)values[6]);
8031 goto __pyx_L4_argument_unpacking_done;
8032 __pyx_L5_argtuple_error:;
8033 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error)
8035 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8036 __Pyx_RefNannyFinishContext();
8038 __pyx_L4_argument_unpacking_done:;
8039 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 273, __pyx_L1_error)
8040 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 274, __pyx_L1_error)
8041 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 275, __pyx_L1_error)
8042 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 276, __pyx_L1_error)
8043 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 277, __pyx_L1_error)
8044 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
8051 __Pyx_RefNannyFinishContext();
8055 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
8058 int __pyx_v_material_left;
8059 int __pyx_v_material_right;
8062 double __pyx_v_numer;
8063 double __pyx_v_denom;
8064 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
8065 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
8066 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
8067 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
8068 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
8069 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
8070 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
8071 __Pyx_Buffer __pyx_pybuffer_x;
8072 PyObject *__pyx_r = NULL;
8073 __Pyx_RefNannyDeclarations
8077 Py_ssize_t __pyx_t_4;
8078 Py_ssize_t __pyx_t_5;
8088 PyObject *__pyx_t_15 = NULL;
8089 PyObject *__pyx_t_16 = NULL;
8090 PyObject *__pyx_t_17 = NULL;
8091 PyObject *__pyx_t_18 = NULL;
8092 PyObject *__pyx_t_19 = NULL;
8094 PyObject *__pyx_t_21 = NULL;
8095 PyObject *__pyx_t_22 = NULL;
8097 Py_ssize_t __pyx_t_24;
8098 int __pyx_lineno = 0;
8099 const char *__pyx_filename = NULL;
8100 int __pyx_clineno = 0;
8101 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
8102 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
8103 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
8104 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
8105 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
8106 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
8107 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
8108 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
8109 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
8110 __pyx_pybuffer_x.pybuffer.buf = NULL;
8111 __pyx_pybuffer_x.refcount = 0;
8112 __pyx_pybuffernd_x.data = NULL;
8113 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
8114 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
8115 __pyx_pybuffer_ebq_global_vals.refcount = 0;
8116 __pyx_pybuffernd_ebq_global_vals.data = NULL;
8117 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
8119 __Pyx_BufFmt_StackElem __pyx_stack[1];
8120 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8122 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
8124 __Pyx_BufFmt_StackElem __pyx_stack[1];
8125 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8127 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
8129 __Pyx_BufFmt_StackElem __pyx_stack[1];
8130 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8132 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
8134 __Pyx_BufFmt_StackElem __pyx_stack[1];
8135 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8137 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
8146 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
8147 __pyx_t_2 = __pyx_t_1;
8148 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
8149 __pyx_v_ebN = __pyx_t_3;
8158 __pyx_t_4 = __pyx_v_ebN;
8161 if (__pyx_t_4 < 0) {
8162 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8163 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
8164 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
8165 if (__pyx_t_5 < 0) {
8166 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8167 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
8168 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
8169 if (unlikely(__pyx_t_6 != -1)) {
8170 __Pyx_RaiseBufferIndexError(__pyx_t_6);
8171 __PYX_ERR(0, 289, __pyx_L1_error)
8173 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
8182 __pyx_t_5 = __pyx_v_ebN;
8185 if (__pyx_t_5 < 0) {
8186 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8187 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
8188 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
8189 if (__pyx_t_4 < 0) {
8190 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8191 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
8192 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
8193 if (unlikely(__pyx_t_6 != -1)) {
8194 __Pyx_RaiseBufferIndexError(__pyx_t_6);
8195 __PYX_ERR(0, 290, __pyx_L1_error)
8197 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
8206 __pyx_t_7 = (__pyx_v_x->dimensions[1]);
8207 __pyx_t_8 = __pyx_t_7;
8208 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) {
8209 __pyx_v_k = __pyx_t_6;
8218 __pyx_t_9 = __pyx_v_nd;
8219 __pyx_t_10 = __pyx_t_9;
8220 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
8221 __pyx_v_I = __pyx_t_11;
8230 __pyx_t_12 = __pyx_v_nd;
8231 __pyx_t_13 = __pyx_t_12;
8232 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
8233 __pyx_v_J = __pyx_t_14;
8242 if (unlikely(__pyx_v_material_functions == Py_None)) {
8243 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8244 __PYX_ERR(0, 294, __pyx_L1_error)
8246 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8247 __Pyx_GOTREF(__pyx_t_16);
8248 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8249 __Pyx_GOTREF(__pyx_t_17);
8250 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8251 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8252 __Pyx_GOTREF(__pyx_t_16);
8253 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8254 __Pyx_GOTREF(__pyx_t_18);
8255 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8256 __Pyx_GOTREF(__pyx_t_19);
8257 __Pyx_GIVEREF(__pyx_t_16);
8258 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_16);
8259 __Pyx_GIVEREF(__pyx_t_18);
8260 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_18);
8263 __pyx_t_18 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_19);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8264 __Pyx_GOTREF(__pyx_t_18);
8265 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8266 __pyx_t_19 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8267 __Pyx_GOTREF(__pyx_t_19);
8270 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
8271 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17);
8272 if (likely(__pyx_t_16)) {
8273 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
8274 __Pyx_INCREF(__pyx_t_16);
8275 __Pyx_INCREF(
function);
8276 __Pyx_DECREF_SET(__pyx_t_17,
function);
8280 #if CYTHON_FAST_PYCALL
8281 if (PyFunction_Check(__pyx_t_17)) {
8282 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_18, __pyx_t_19};
8283 __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8284 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8285 __Pyx_GOTREF(__pyx_t_15);
8286 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8287 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8290 #if CYTHON_FAST_PYCCALL
8291 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
8292 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_18, __pyx_t_19};
8293 __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8294 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8295 __Pyx_GOTREF(__pyx_t_15);
8296 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8297 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8301 __pyx_t_21 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8302 __Pyx_GOTREF(__pyx_t_21);
8304 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_16); __pyx_t_16 = NULL;
8306 __Pyx_GIVEREF(__pyx_t_18);
8307 PyTuple_SET_ITEM(__pyx_t_21, 0+__pyx_t_20, __pyx_t_18);
8308 __Pyx_GIVEREF(__pyx_t_19);
8309 PyTuple_SET_ITEM(__pyx_t_21, 1+__pyx_t_20, __pyx_t_19);
8312 __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_21, NULL);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8313 __Pyx_GOTREF(__pyx_t_15);
8314 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8316 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8317 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8318 __Pyx_GOTREF(__pyx_t_17);
8319 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8320 __Pyx_GOTREF(__pyx_t_21);
8321 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8322 __Pyx_GOTREF(__pyx_t_19);
8323 __Pyx_GIVEREF(__pyx_t_17);
8324 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17);
8325 __Pyx_GIVEREF(__pyx_t_21);
8326 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_21);
8329 __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_19);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8330 __Pyx_GOTREF(__pyx_t_21);
8331 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8332 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8333 __pyx_t_19 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_21);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8334 __Pyx_GOTREF(__pyx_t_19);
8335 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8336 if (unlikely(__pyx_v_material_functions == Py_None)) {
8337 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8338 __PYX_ERR(0, 294, __pyx_L1_error)
8340 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8341 __Pyx_GOTREF(__pyx_t_15);
8342 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8343 __Pyx_GOTREF(__pyx_t_17);
8344 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8345 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8346 __Pyx_GOTREF(__pyx_t_15);
8347 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8348 __Pyx_GOTREF(__pyx_t_18);
8349 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8350 __Pyx_GOTREF(__pyx_t_16);
8351 __Pyx_GIVEREF(__pyx_t_15);
8352 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
8353 __Pyx_GIVEREF(__pyx_t_18);
8354 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_18);
8357 __pyx_t_18 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8358 __Pyx_GOTREF(__pyx_t_18);
8359 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8360 __pyx_t_16 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8361 __Pyx_GOTREF(__pyx_t_16);
8364 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
8365 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_17);
8366 if (likely(__pyx_t_15)) {
8367 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
8368 __Pyx_INCREF(__pyx_t_15);
8369 __Pyx_INCREF(
function);
8370 __Pyx_DECREF_SET(__pyx_t_17,
function);
8374 #if CYTHON_FAST_PYCALL
8375 if (PyFunction_Check(__pyx_t_17)) {
8376 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_18, __pyx_t_16};
8377 __pyx_t_21 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8378 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
8379 __Pyx_GOTREF(__pyx_t_21);
8380 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8381 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8384 #if CYTHON_FAST_PYCCALL
8385 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
8386 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_18, __pyx_t_16};
8387 __pyx_t_21 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8388 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
8389 __Pyx_GOTREF(__pyx_t_21);
8390 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8391 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8395 __pyx_t_22 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 294, __pyx_L1_error)
8396 __Pyx_GOTREF(__pyx_t_22);
8398 __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_15); __pyx_t_15 = NULL;
8400 __Pyx_GIVEREF(__pyx_t_18);
8401 PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_20, __pyx_t_18);
8402 __Pyx_GIVEREF(__pyx_t_16);
8403 PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_20, __pyx_t_16);
8406 __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_22, NULL);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8407 __Pyx_GOTREF(__pyx_t_21);
8408 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8410 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8411 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8412 __Pyx_GOTREF(__pyx_t_17);
8413 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 294, __pyx_L1_error)
8414 __Pyx_GOTREF(__pyx_t_22);
8415 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8416 __Pyx_GOTREF(__pyx_t_16);
8417 __Pyx_GIVEREF(__pyx_t_17);
8418 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17);
8419 __Pyx_GIVEREF(__pyx_t_22);
8420 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_22);
8423 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_21, __pyx_t_16);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 294, __pyx_L1_error)
8424 __Pyx_GOTREF(__pyx_t_22);
8425 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8426 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8427 __pyx_t_16 = PyNumber_Multiply(__pyx_t_19, __pyx_t_22);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8428 __Pyx_GOTREF(__pyx_t_16);
8429 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8430 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8431 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_16);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
8432 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8433 __pyx_v_numer = __pyx_t_23;
8442 if (unlikely(__pyx_v_material_functions == Py_None)) {
8443 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8444 __PYX_ERR(0, 295, __pyx_L1_error)
8446 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8447 __Pyx_GOTREF(__pyx_t_22);
8448 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8449 __Pyx_GOTREF(__pyx_t_19);
8450 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8451 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8452 __Pyx_GOTREF(__pyx_t_22);
8453 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8454 __Pyx_GOTREF(__pyx_t_21);
8455 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8456 __Pyx_GOTREF(__pyx_t_17);
8457 __Pyx_GIVEREF(__pyx_t_22);
8458 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_22);
8459 __Pyx_GIVEREF(__pyx_t_21);
8460 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_21);
8463 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_17);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8464 __Pyx_GOTREF(__pyx_t_21);
8465 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8466 __pyx_t_17 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8467 __Pyx_GOTREF(__pyx_t_17);
8470 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
8471 __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_19);
8472 if (likely(__pyx_t_22)) {
8473 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
8474 __Pyx_INCREF(__pyx_t_22);
8475 __Pyx_INCREF(
function);
8476 __Pyx_DECREF_SET(__pyx_t_19,
function);
8480 #if CYTHON_FAST_PYCALL
8481 if (PyFunction_Check(__pyx_t_19)) {
8482 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_17};
8483 __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8484 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
8485 __Pyx_GOTREF(__pyx_t_16);
8486 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8487 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8490 #if CYTHON_FAST_PYCCALL
8491 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
8492 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_17};
8493 __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8494 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
8495 __Pyx_GOTREF(__pyx_t_16);
8496 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8497 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8501 __pyx_t_18 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8502 __Pyx_GOTREF(__pyx_t_18);
8504 __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_22); __pyx_t_22 = NULL;
8506 __Pyx_GIVEREF(__pyx_t_21);
8507 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_20, __pyx_t_21);
8508 __Pyx_GIVEREF(__pyx_t_17);
8509 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_20, __pyx_t_17);
8512 __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8513 __Pyx_GOTREF(__pyx_t_16);
8514 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8516 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8517 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8518 __Pyx_GOTREF(__pyx_t_19);
8519 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8520 __Pyx_GOTREF(__pyx_t_18);
8521 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8522 __Pyx_GOTREF(__pyx_t_17);
8523 __Pyx_GIVEREF(__pyx_t_19);
8524 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_19);
8525 __Pyx_GIVEREF(__pyx_t_18);
8526 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_18);
8529 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8530 __Pyx_GOTREF(__pyx_t_18);
8531 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8532 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8533 if (unlikely(__pyx_v_material_functions == Py_None)) {
8534 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8535 __PYX_ERR(0, 295, __pyx_L1_error)
8537 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8538 __Pyx_GOTREF(__pyx_t_16);
8539 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8540 __Pyx_GOTREF(__pyx_t_19);
8541 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8542 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8543 __Pyx_GOTREF(__pyx_t_16);
8544 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8545 __Pyx_GOTREF(__pyx_t_21);
8546 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8547 __Pyx_GOTREF(__pyx_t_22);
8548 __Pyx_GIVEREF(__pyx_t_16);
8549 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_16);
8550 __Pyx_GIVEREF(__pyx_t_21);
8551 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_21);
8554 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_22);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8555 __Pyx_GOTREF(__pyx_t_21);
8556 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8557 __pyx_t_22 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8558 __Pyx_GOTREF(__pyx_t_22);
8561 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
8562 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_19);
8563 if (likely(__pyx_t_16)) {
8564 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
8565 __Pyx_INCREF(__pyx_t_16);
8566 __Pyx_INCREF(
function);
8567 __Pyx_DECREF_SET(__pyx_t_19,
function);
8571 #if CYTHON_FAST_PYCALL
8572 if (PyFunction_Check(__pyx_t_19)) {
8573 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_21, __pyx_t_22};
8574 __pyx_t_17 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8575 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8576 __Pyx_GOTREF(__pyx_t_17);
8577 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8578 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8581 #if CYTHON_FAST_PYCCALL
8582 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
8583 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_21, __pyx_t_22};
8584 __pyx_t_17 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8585 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8586 __Pyx_GOTREF(__pyx_t_17);
8587 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8588 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8592 __pyx_t_15 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8593 __Pyx_GOTREF(__pyx_t_15);
8595 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); __pyx_t_16 = NULL;
8597 __Pyx_GIVEREF(__pyx_t_21);
8598 PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_20, __pyx_t_21);
8599 __Pyx_GIVEREF(__pyx_t_22);
8600 PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_20, __pyx_t_22);
8603 __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_15, NULL);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8604 __Pyx_GOTREF(__pyx_t_17);
8605 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8607 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8608 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8609 __Pyx_GOTREF(__pyx_t_19);
8610 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8611 __Pyx_GOTREF(__pyx_t_15);
8612 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8613 __Pyx_GOTREF(__pyx_t_22);
8614 __Pyx_GIVEREF(__pyx_t_19);
8615 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_19);
8616 __Pyx_GIVEREF(__pyx_t_15);
8617 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_15);
8620 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_22);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8621 __Pyx_GOTREF(__pyx_t_15);
8622 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8623 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8624 __pyx_t_22 = PyNumber_Add(__pyx_t_18, __pyx_t_15);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8625 __Pyx_GOTREF(__pyx_t_22);
8626 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8627 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8628 __pyx_t_15 = __Pyx_PyFloat_AddObjC(__pyx_t_22, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8629 __Pyx_GOTREF(__pyx_t_15);
8630 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8631 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_15);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error)
8632 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8633 __pyx_v_denom = __pyx_t_23;
8642 if (unlikely(__pyx_v_denom == 0)) {
8643 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
8644 __PYX_ERR(0, 296, __pyx_L1_error)
8646 __pyx_t_4 = __pyx_v_ebN;
8647 __pyx_t_5 = __pyx_v_k;
8648 __pyx_t_24 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
8650 if (__pyx_t_4 < 0) {
8651 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
8652 if (unlikely(__pyx_t_4 < 0)) __pyx_t_20 = 0;
8653 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_20 = 0;
8654 if (__pyx_t_5 < 0) {
8655 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
8656 if (unlikely(__pyx_t_5 < 0)) __pyx_t_20 = 1;
8657 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_20 = 1;
8658 if (__pyx_t_24 < 0) {
8659 __pyx_t_24 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
8660 if (unlikely(__pyx_t_24 < 0)) __pyx_t_20 = 2;
8661 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_20 = 2;
8662 if (unlikely(__pyx_t_20 != -1)) {
8663 __Pyx_RaiseBufferIndexError(__pyx_t_20);
8664 __PYX_ERR(0, 296, __pyx_L1_error)
8666 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
8681 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8684 __Pyx_XDECREF(__pyx_t_15);
8685 __Pyx_XDECREF(__pyx_t_16);
8686 __Pyx_XDECREF(__pyx_t_17);
8687 __Pyx_XDECREF(__pyx_t_18);
8688 __Pyx_XDECREF(__pyx_t_19);
8689 __Pyx_XDECREF(__pyx_t_21);
8690 __Pyx_XDECREF(__pyx_t_22);
8691 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8692 __Pyx_PyThreadState_declare
8693 __Pyx_PyThreadState_assign
8694 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8695 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8696 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8697 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8698 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8699 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8700 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8704 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8705 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8706 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8707 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8709 __Pyx_XGIVEREF(__pyx_r);
8710 __Pyx_RefNannyFinishContext();
8723 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8724 static char __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear[] =
"\n routine for evaluating linaer interface (nodal) coefficients in NCP1 approximation for Darcy Flow\n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
8725 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear = {
"RE_NCP1_evaluateElementCoefficients_Linear", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear};
8726 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8728 PyArrayObject *__pyx_v_gravity = 0;
8729 PyArrayObject *__pyx_v_rowptr = 0;
8730 PyArrayObject *__pyx_v_colind = 0;
8731 PyArrayObject *__pyx_v_KWs = 0;
8733 int __pyx_v_nElements_global;
8734 int __pyx_v_nElementBoundaries_element;
8735 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
8736 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
8737 PyArrayObject *__pyx_v_q_flin = 0;
8738 PyArrayObject *__pyx_v_q_alin = 0;
8739 int __pyx_lineno = 0;
8740 const char *__pyx_filename = NULL;
8741 int __pyx_clineno = 0;
8742 PyObject *__pyx_r = 0;
8743 __Pyx_RefNannyDeclarations
8744 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear (wrapper)", 0);
8746 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_KWs,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,0};
8747 PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
8748 if (unlikely(__pyx_kwds)) {
8750 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8752 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8754 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8756 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8758 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8760 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8762 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8764 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8766 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8768 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8770 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8772 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8774 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8777 default:
goto __pyx_L5_argtuple_error;
8779 kw_args = PyDict_Size(__pyx_kwds);
8782 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
8783 else goto __pyx_L5_argtuple_error;
8786 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
8788 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 1); __PYX_ERR(0, 301, __pyx_L3_error)
8792 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
8794 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 2); __PYX_ERR(0, 301, __pyx_L3_error)
8798 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
8800 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 3); __PYX_ERR(0, 301, __pyx_L3_error)
8804 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_KWs)) != 0)) kw_args--;
8806 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 4); __PYX_ERR(0, 301, __pyx_L3_error)
8810 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
8812 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 5); __PYX_ERR(0, 301, __pyx_L3_error)
8816 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
8818 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 6); __PYX_ERR(0, 301, __pyx_L3_error)
8822 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
8824 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 7); __PYX_ERR(0, 301, __pyx_L3_error)
8828 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
8830 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 8); __PYX_ERR(0, 301, __pyx_L3_error)
8834 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
8836 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 9); __PYX_ERR(0, 301, __pyx_L3_error)
8840 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
8842 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 10); __PYX_ERR(0, 301, __pyx_L3_error)
8846 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
8848 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 11); __PYX_ERR(0, 301, __pyx_L3_error)
8851 if (unlikely(kw_args > 0)) {
8852 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_Linear") < 0)) __PYX_ERR(0, 301, __pyx_L3_error)
8854 }
else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
8855 goto __pyx_L5_argtuple_error;
8857 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8858 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8859 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8860 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8861 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8862 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8863 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8864 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8865 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8866 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8867 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8868 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8870 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error)
8871 __pyx_v_gravity = ((PyArrayObject *)values[1]);
8872 __pyx_v_rowptr = ((PyArrayObject *)values[2]);
8873 __pyx_v_colind = ((PyArrayObject *)values[3]);
8874 __pyx_v_KWs = ((PyArrayObject *)values[4]);
8875 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error)
8876 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[6]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L3_error)
8877 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error)
8878 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[8]);
8879 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[9]);
8880 __pyx_v_q_flin = ((PyArrayObject *)values[10]);
8881 __pyx_v_q_alin = ((PyArrayObject *)values[11]);
8883 goto __pyx_L4_argument_unpacking_done;
8884 __pyx_L5_argtuple_error:;
8885 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 301, __pyx_L3_error)
8887 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
8888 __Pyx_RefNannyFinishContext();
8890 __pyx_L4_argument_unpacking_done:;
8891 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 302, __pyx_L1_error)
8892 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 303, __pyx_L1_error)
8893 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 304, __pyx_L1_error)
8894 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_KWs), __pyx_ptype_5numpy_ndarray, 1,
"KWs", 0))) __PYX_ERR(0, 305, __pyx_L1_error)
8895 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 310, __pyx_L1_error)
8896 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 311, __pyx_L1_error)
8897 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 312, __pyx_L1_error)
8898 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 313, __pyx_L1_error)
8899 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(__pyx_self, __pyx_v_rho, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_KWs, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementMaterialTypes, __pyx_v_q_flin, __pyx_v_q_alin);
8906 __Pyx_RefNannyFinishContext();
8910 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin) {
8912 int __pyx_v_eN_neighbor;
8917 int __pyx_v_matID_neig;
8918 CYTHON_UNUSED
int __pyx_v_nSpace2;
8920 PyArrayObject *__pyx_v_a_eN = 0;
8921 PyArrayObject *__pyx_v_a_neig = 0;
8922 PyArrayObject *__pyx_v_a_avg = 0;
8923 __Pyx_LocalBuf_ND __pyx_pybuffernd_KWs;
8924 __Pyx_Buffer __pyx_pybuffer_KWs;
8925 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_avg;
8926 __Pyx_Buffer __pyx_pybuffer_a_avg;
8927 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_eN;
8928 __Pyx_Buffer __pyx_pybuffer_a_eN;
8929 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_neig;
8930 __Pyx_Buffer __pyx_pybuffer_a_neig;
8931 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
8932 __Pyx_Buffer __pyx_pybuffer_colind;
8933 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
8934 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
8935 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
8936 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
8937 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
8938 __Pyx_Buffer __pyx_pybuffer_gravity;
8939 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
8940 __Pyx_Buffer __pyx_pybuffer_q_alin;
8941 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
8942 __Pyx_Buffer __pyx_pybuffer_q_flin;
8943 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
8944 __Pyx_Buffer __pyx_pybuffer_rowptr;
8945 PyObject *__pyx_r = NULL;
8946 __Pyx_RefNannyDeclarations
8947 Py_ssize_t __pyx_t_1;
8949 PyObject *__pyx_t_3 = NULL;
8950 PyObject *__pyx_t_4 = NULL;
8951 PyObject *__pyx_t_5 = NULL;
8952 PyObject *__pyx_t_6 = NULL;
8953 PyObject *__pyx_t_7 = NULL;
8954 PyArrayObject *__pyx_t_8 = NULL;
8955 PyArrayObject *__pyx_t_9 = NULL;
8956 PyArrayObject *__pyx_t_10 = NULL;
8962 Py_ssize_t __pyx_t_16;
8964 Py_ssize_t __pyx_t_18;
8969 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_23;
8970 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_24;
8971 Py_ssize_t __pyx_t_25;
8972 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_26;
8973 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_27;
8975 Py_ssize_t __pyx_t_29;
8976 Py_ssize_t __pyx_t_30;
8977 Py_ssize_t __pyx_t_31;
8978 int __pyx_lineno = 0;
8979 const char *__pyx_filename = NULL;
8980 int __pyx_clineno = 0;
8981 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear", 0);
8982 __pyx_pybuffer_a_eN.pybuffer.buf = NULL;
8983 __pyx_pybuffer_a_eN.refcount = 0;
8984 __pyx_pybuffernd_a_eN.data = NULL;
8985 __pyx_pybuffernd_a_eN.rcbuffer = &__pyx_pybuffer_a_eN;
8986 __pyx_pybuffer_a_neig.pybuffer.buf = NULL;
8987 __pyx_pybuffer_a_neig.refcount = 0;
8988 __pyx_pybuffernd_a_neig.data = NULL;
8989 __pyx_pybuffernd_a_neig.rcbuffer = &__pyx_pybuffer_a_neig;
8990 __pyx_pybuffer_a_avg.pybuffer.buf = NULL;
8991 __pyx_pybuffer_a_avg.refcount = 0;
8992 __pyx_pybuffernd_a_avg.data = NULL;
8993 __pyx_pybuffernd_a_avg.rcbuffer = &__pyx_pybuffer_a_avg;
8994 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
8995 __pyx_pybuffer_gravity.refcount = 0;
8996 __pyx_pybuffernd_gravity.data = NULL;
8997 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
8998 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
8999 __pyx_pybuffer_rowptr.refcount = 0;
9000 __pyx_pybuffernd_rowptr.data = NULL;
9001 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
9002 __pyx_pybuffer_colind.pybuffer.buf = NULL;
9003 __pyx_pybuffer_colind.refcount = 0;
9004 __pyx_pybuffernd_colind.data = NULL;
9005 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
9006 __pyx_pybuffer_KWs.pybuffer.buf = NULL;
9007 __pyx_pybuffer_KWs.refcount = 0;
9008 __pyx_pybuffernd_KWs.data = NULL;
9009 __pyx_pybuffernd_KWs.rcbuffer = &__pyx_pybuffer_KWs;
9010 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
9011 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
9012 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
9013 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
9014 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
9015 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
9016 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
9017 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
9018 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
9019 __pyx_pybuffer_q_flin.refcount = 0;
9020 __pyx_pybuffernd_q_flin.data = NULL;
9021 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
9022 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
9023 __pyx_pybuffer_q_alin.refcount = 0;
9024 __pyx_pybuffernd_q_alin.data = NULL;
9025 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
9027 __Pyx_BufFmt_StackElem __pyx_stack[1];
9028 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9030 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
9032 __Pyx_BufFmt_StackElem __pyx_stack[1];
9033 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9035 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
9037 __Pyx_BufFmt_StackElem __pyx_stack[1];
9038 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9040 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
9042 __Pyx_BufFmt_StackElem __pyx_stack[1];
9043 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer, (PyObject*)__pyx_v_KWs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9045 __pyx_pybuffernd_KWs.diminfo[0].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_KWs.diminfo[0].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_KWs.diminfo[1].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_KWs.diminfo[1].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[1];
9047 __Pyx_BufFmt_StackElem __pyx_stack[1];
9048 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9050 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
9052 __Pyx_BufFmt_StackElem __pyx_stack[1];
9053 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9055 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
9057 __Pyx_BufFmt_StackElem __pyx_stack[1];
9058 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9060 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
9062 __Pyx_BufFmt_StackElem __pyx_stack[1];
9063 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9065 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
9074 __pyx_v_nSpace2 = (__pyx_v_nSpace * __pyx_v_nSpace);
9083 __pyx_t_1 = __pyx_v_nSpace;
9085 if (__pyx_t_1 < 0) {
9086 __pyx_t_1 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9087 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
9088 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_2 = 0;
9089 if (unlikely(__pyx_t_2 != -1)) {
9090 __Pyx_RaiseBufferIndexError(__pyx_t_2);
9091 __PYX_ERR(0, 329, __pyx_L1_error)
9093 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_rowptr.diminfo[0].strides));
9102 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
9103 __Pyx_GOTREF(__pyx_t_4);
9104 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error)
9105 __Pyx_GOTREF(__pyx_t_5);
9106 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9107 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
9108 __Pyx_GOTREF(__pyx_t_4);
9111 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9112 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9113 if (likely(__pyx_t_6)) {
9114 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
9115 __Pyx_INCREF(__pyx_t_6);
9116 __Pyx_INCREF(
function);
9117 __Pyx_DECREF_SET(__pyx_t_5,
function);
9121 #if CYTHON_FAST_PYCALL
9122 if (PyFunction_Check(__pyx_t_5)) {
9123 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
9124 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9125 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9126 __Pyx_GOTREF(__pyx_t_3);
9127 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9130 #if CYTHON_FAST_PYCCALL
9131 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9132 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
9133 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9134 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9135 __Pyx_GOTREF(__pyx_t_3);
9136 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9140 __pyx_t_7 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
9141 __Pyx_GOTREF(__pyx_t_7);
9143 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
9145 __Pyx_GIVEREF(__pyx_t_4);
9146 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, __pyx_t_4);
9147 __Pyx_INCREF(__pyx_n_s_d);
9148 __Pyx_GIVEREF(__pyx_n_s_d);
9149 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_n_s_d);
9151 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9152 __Pyx_GOTREF(__pyx_t_3);
9153 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9155 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9156 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 331, __pyx_L1_error)
9157 __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
9159 __Pyx_BufFmt_StackElem __pyx_stack[1];
9160 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9161 __pyx_v_a_eN = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf = NULL;
9162 __PYX_ERR(0, 331, __pyx_L1_error)
9163 }
else {__pyx_pybuffernd_a_eN.diminfo[0].strides = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_eN.diminfo[0].shape = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.shape[0];
9167 __pyx_v_a_eN = ((PyArrayObject *)__pyx_t_3);
9177 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
9178 __Pyx_GOTREF(__pyx_t_5);
9179 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
9180 __Pyx_GOTREF(__pyx_t_7);
9181 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9182 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
9183 __Pyx_GOTREF(__pyx_t_5);
9186 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
9187 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
9188 if (likely(__pyx_t_4)) {
9189 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
9190 __Pyx_INCREF(__pyx_t_4);
9191 __Pyx_INCREF(
function);
9192 __Pyx_DECREF_SET(__pyx_t_7,
function);
9196 #if CYTHON_FAST_PYCALL
9197 if (PyFunction_Check(__pyx_t_7)) {
9198 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
9199 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9200 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9201 __Pyx_GOTREF(__pyx_t_3);
9202 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9205 #if CYTHON_FAST_PYCCALL
9206 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
9207 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
9208 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9209 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9210 __Pyx_GOTREF(__pyx_t_3);
9211 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9215 __pyx_t_6 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
9216 __Pyx_GOTREF(__pyx_t_6);
9218 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
9220 __Pyx_GIVEREF(__pyx_t_5);
9221 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_t_5);
9222 __Pyx_INCREF(__pyx_n_s_d);
9223 __Pyx_GIVEREF(__pyx_n_s_d);
9224 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_n_s_d);
9226 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9227 __Pyx_GOTREF(__pyx_t_3);
9228 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9230 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9231 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 332, __pyx_L1_error)
9232 __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
9234 __Pyx_BufFmt_StackElem __pyx_stack[1];
9235 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9236 __pyx_v_a_neig = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf = NULL;
9237 __PYX_ERR(0, 332, __pyx_L1_error)
9238 }
else {__pyx_pybuffernd_a_neig.diminfo[0].strides = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_neig.diminfo[0].shape = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.shape[0];
9242 __pyx_v_a_neig = ((PyArrayObject *)__pyx_t_3);
9252 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
9253 __Pyx_GOTREF(__pyx_t_7);
9254 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
9255 __Pyx_GOTREF(__pyx_t_6);
9256 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9257 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
9258 __Pyx_GOTREF(__pyx_t_7);
9261 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
9262 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
9263 if (likely(__pyx_t_5)) {
9264 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
9265 __Pyx_INCREF(__pyx_t_5);
9266 __Pyx_INCREF(
function);
9267 __Pyx_DECREF_SET(__pyx_t_6,
function);
9271 #if CYTHON_FAST_PYCALL
9272 if (PyFunction_Check(__pyx_t_6)) {
9273 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
9274 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9275 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9276 __Pyx_GOTREF(__pyx_t_3);
9277 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9280 #if CYTHON_FAST_PYCCALL
9281 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
9282 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
9283 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9284 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9285 __Pyx_GOTREF(__pyx_t_3);
9286 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9290 __pyx_t_4 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
9291 __Pyx_GOTREF(__pyx_t_4);
9293 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
9295 __Pyx_GIVEREF(__pyx_t_7);
9296 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_2, __pyx_t_7);
9297 __Pyx_INCREF(__pyx_n_s_d);
9298 __Pyx_GIVEREF(__pyx_n_s_d);
9299 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_2, __pyx_n_s_d);
9301 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9302 __Pyx_GOTREF(__pyx_t_3);
9303 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9305 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9306 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 333, __pyx_L1_error)
9307 __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
9309 __Pyx_BufFmt_StackElem __pyx_stack[1];
9310 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9311 __pyx_v_a_avg = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf = NULL;
9312 __PYX_ERR(0, 333, __pyx_L1_error)
9313 }
else {__pyx_pybuffernd_a_avg.diminfo[0].strides = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_avg.diminfo[0].shape = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.shape[0];
9317 __pyx_v_a_avg = ((PyArrayObject *)__pyx_t_3);
9327 __pyx_t_2 = __pyx_v_nElements_global;
9328 __pyx_t_11 = __pyx_t_2;
9329 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
9330 __pyx_v_eN = __pyx_t_12;
9339 __pyx_t_1 = __pyx_v_eN;
9341 if (__pyx_t_1 < 0) {
9342 __pyx_t_1 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9343 if (unlikely(__pyx_t_1 < 0)) __pyx_t_13 = 0;
9344 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_13 = 0;
9345 if (unlikely(__pyx_t_13 != -1)) {
9346 __Pyx_RaiseBufferIndexError(__pyx_t_13);
9347 __PYX_ERR(0, 337, __pyx_L1_error)
9349 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9358 __pyx_t_13 = __pyx_v_nnz;
9359 __pyx_t_14 = __pyx_t_13;
9360 for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
9361 __pyx_v_ii = __pyx_t_15;
9370 __pyx_t_1 = __pyx_v_matID;
9371 __pyx_t_16 = __pyx_v_ii;
9373 if (__pyx_t_1 < 0) {
9374 __pyx_t_1 += __pyx_pybuffernd_KWs.diminfo[0].shape;
9375 if (unlikely(__pyx_t_1 < 0)) __pyx_t_17 = 0;
9376 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_17 = 0;
9377 if (__pyx_t_16 < 0) {
9378 __pyx_t_16 += __pyx_pybuffernd_KWs.diminfo[1].shape;
9379 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
9380 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_17 = 1;
9381 if (unlikely(__pyx_t_17 != -1)) {
9382 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9383 __PYX_ERR(0, 339, __pyx_L1_error)
9385 __pyx_t_18 = __pyx_v_ii;
9387 if (__pyx_t_18 < 0) {
9388 __pyx_t_18 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9389 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
9390 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_17 = 0;
9391 if (unlikely(__pyx_t_17 != -1)) {
9392 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9393 __PYX_ERR(0, 339, __pyx_L1_error)
9395 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_a_eN.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_KWs.diminfo[1].strides)));
9405 __pyx_t_13 = __pyx_v_nElementBoundaries_element;
9406 __pyx_t_14 = __pyx_t_13;
9407 for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
9408 __pyx_v_ebN = __pyx_t_15;
9417 __pyx_t_16 = __pyx_v_eN;
9418 __pyx_t_1 = __pyx_v_ebN;
9420 if (__pyx_t_16 < 0) {
9421 __pyx_t_16 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
9422 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0;
9423 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_17 = 0;
9424 if (__pyx_t_1 < 0) {
9425 __pyx_t_1 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
9426 if (unlikely(__pyx_t_1 < 0)) __pyx_t_17 = 1;
9427 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_17 = 1;
9428 if (unlikely(__pyx_t_17 != -1)) {
9429 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9430 __PYX_ERR(0, 341, __pyx_L1_error)
9432 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_1, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
9441 __pyx_t_17 = __pyx_v_nnz;
9442 __pyx_t_19 = __pyx_t_17;
9443 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9444 __pyx_v_ii = __pyx_t_20;
9453 __pyx_t_1 = __pyx_v_ii;
9455 if (__pyx_t_1 < 0) {
9456 __pyx_t_1 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9457 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9458 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_21 = 0;
9459 if (unlikely(__pyx_t_21 != -1)) {
9460 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9461 __PYX_ERR(0, 343, __pyx_L1_error)
9463 __pyx_t_16 = __pyx_v_ii;
9465 if (__pyx_t_16 < 0) {
9466 __pyx_t_16 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9467 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9468 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9469 if (unlikely(__pyx_t_21 != -1)) {
9470 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9471 __PYX_ERR(0, 343, __pyx_L1_error)
9473 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_eN.diminfo[0].strides));
9483 __pyx_t_22 = ((__pyx_v_eN_neighbor >= 0) != 0);
9493 __pyx_t_1 = __pyx_v_eN_neighbor;
9495 if (__pyx_t_1 < 0) {
9496 __pyx_t_1 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9497 if (unlikely(__pyx_t_1 < 0)) __pyx_t_17 = 0;
9498 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_17 = 0;
9499 if (unlikely(__pyx_t_17 != -1)) {
9500 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9501 __PYX_ERR(0, 345, __pyx_L1_error)
9503 __pyx_v_matID_neig = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9512 __pyx_t_17 = __pyx_v_nnz;
9513 __pyx_t_19 = __pyx_t_17;
9514 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9515 __pyx_v_ii = __pyx_t_20;
9524 __pyx_t_1 = __pyx_v_matID_neig;
9525 __pyx_t_16 = __pyx_v_ii;
9527 if (__pyx_t_1 < 0) {
9528 __pyx_t_1 += __pyx_pybuffernd_KWs.diminfo[0].shape;
9529 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9530 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_21 = 0;
9531 if (__pyx_t_16 < 0) {
9532 __pyx_t_16 += __pyx_pybuffernd_KWs.diminfo[1].shape;
9533 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 1;
9534 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_21 = 1;
9535 if (unlikely(__pyx_t_21 != -1)) {
9536 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9537 __PYX_ERR(0, 347, __pyx_L1_error)
9539 __pyx_t_18 = __pyx_v_ii;
9541 if (__pyx_t_18 < 0) {
9542 __pyx_t_18 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9543 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 0;
9544 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9545 if (unlikely(__pyx_t_21 != -1)) {
9546 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9547 __PYX_ERR(0, 347, __pyx_L1_error)
9549 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_KWs.diminfo[1].strides)));
9568 __pyx_t_17 = __pyx_v_nnz;
9569 __pyx_t_19 = __pyx_t_17;
9570 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9571 __pyx_v_ii = __pyx_t_20;
9580 __pyx_t_16 = __pyx_v_ii;
9582 if (__pyx_t_16 < 0) {
9583 __pyx_t_16 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9584 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9585 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_21 = 0;
9586 if (unlikely(__pyx_t_21 != -1)) {
9587 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9588 __PYX_ERR(0, 349, __pyx_L1_error)
9590 __pyx_t_1 = __pyx_v_ii;
9592 if (__pyx_t_1 < 0) {
9593 __pyx_t_1 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9594 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9595 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9596 if (unlikely(__pyx_t_21 != -1)) {
9597 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9598 __PYX_ERR(0, 349, __pyx_L1_error)
9600 __pyx_t_23 = ((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_eN.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_neig.diminfo[0].strides)));
9601 __pyx_t_1 = __pyx_v_ii;
9603 if (__pyx_t_1 < 0) {
9604 __pyx_t_1 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9605 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9606 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_21 = 0;
9607 if (unlikely(__pyx_t_21 != -1)) {
9608 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9609 __PYX_ERR(0, 349, __pyx_L1_error)
9611 __pyx_t_16 = __pyx_v_ii;
9613 if (__pyx_t_16 < 0) {
9614 __pyx_t_16 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9615 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9616 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9617 if (unlikely(__pyx_t_21 != -1)) {
9618 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9619 __PYX_ERR(0, 349, __pyx_L1_error)
9621 __pyx_t_24 = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_eN.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_neig.diminfo[0].strides))) + 1.0e-20);
9622 if (unlikely(__pyx_t_24 == 0)) {
9623 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
9624 __PYX_ERR(0, 349, __pyx_L1_error)
9626 __pyx_t_16 = __pyx_v_ii;
9628 if (__pyx_t_16 < 0) {
9629 __pyx_t_16 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9630 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9631 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_21 = 0;
9632 if (unlikely(__pyx_t_21 != -1)) {
9633 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9634 __PYX_ERR(0, 349, __pyx_L1_error)
9636 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_avg.diminfo[0].strides) = (__pyx_t_23 / __pyx_t_24);
9645 __pyx_t_16 = __pyx_v_ii;
9647 if (__pyx_t_16 < 0) {
9648 __pyx_t_16 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9649 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9650 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_21 = 0;
9651 if (unlikely(__pyx_t_21 != -1)) {
9652 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9653 __PYX_ERR(0, 350, __pyx_L1_error)
9655 __pyx_t_1 = __pyx_v_eN;
9656 __pyx_t_18 = __pyx_v_ebN;
9657 __pyx_t_25 = __pyx_v_ii;
9659 if (__pyx_t_1 < 0) {
9660 __pyx_t_1 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
9661 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9662 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_21 = 0;
9663 if (__pyx_t_18 < 0) {
9664 __pyx_t_18 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
9665 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 1;
9666 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_21 = 1;
9667 if (__pyx_t_25 < 0) {
9668 __pyx_t_25 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
9669 if (unlikely(__pyx_t_25 < 0)) __pyx_t_21 = 2;
9670 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_21 = 2;
9671 if (unlikely(__pyx_t_21 != -1)) {
9672 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9673 __PYX_ERR(0, 350, __pyx_L1_error)
9675 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_q_alin.diminfo[2].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_avg.diminfo[0].strides));
9685 __pyx_t_17 = __pyx_v_nSpace;
9686 __pyx_t_19 = __pyx_t_17;
9687 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9688 __pyx_v_I = __pyx_t_20;
9697 __pyx_t_16 = __pyx_v_eN;
9698 __pyx_t_25 = __pyx_v_ebN;
9699 __pyx_t_18 = __pyx_v_I;
9701 if (__pyx_t_16 < 0) {
9702 __pyx_t_16 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9703 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9704 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_21 = 0;
9705 if (__pyx_t_25 < 0) {
9706 __pyx_t_25 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9707 if (unlikely(__pyx_t_25 < 0)) __pyx_t_21 = 1;
9708 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_21 = 1;
9709 if (__pyx_t_18 < 0) {
9710 __pyx_t_18 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9711 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 2;
9712 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_21 = 2;
9713 if (unlikely(__pyx_t_21 != -1)) {
9714 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9715 __PYX_ERR(0, 352, __pyx_L1_error)
9717 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_q_flin.diminfo[2].strides) = 0.0;
9726 __pyx_t_18 = (__pyx_v_I + 1);
9728 if (__pyx_t_18 < 0) {
9729 __pyx_t_18 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9730 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 0;
9731 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_21 = 0;
9732 if (unlikely(__pyx_t_21 != -1)) {
9733 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9734 __PYX_ERR(0, 353, __pyx_L1_error)
9736 __pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_rowptr.diminfo[0].strides));
9737 __pyx_t_18 = __pyx_v_I;
9739 if (__pyx_t_18 < 0) {
9740 __pyx_t_18 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9741 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 0;
9742 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_21 = 0;
9743 if (unlikely(__pyx_t_21 != -1)) {
9744 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9745 __PYX_ERR(0, 353, __pyx_L1_error)
9747 __pyx_t_27 = __pyx_t_26;
9748 for (__pyx_t_21 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_21 < __pyx_t_27; __pyx_t_21+=1) {
9749 __pyx_v_ii = __pyx_t_21;
9758 __pyx_t_25 = __pyx_v_ii;
9760 if (__pyx_t_25 < 0) {
9761 __pyx_t_25 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9762 if (unlikely(__pyx_t_25 < 0)) __pyx_t_28 = 0;
9763 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_28 = 0;
9764 if (unlikely(__pyx_t_28 != -1)) {
9765 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9766 __PYX_ERR(0, 354, __pyx_L1_error)
9768 __pyx_t_16 = __pyx_v_ii;
9770 if (__pyx_t_16 < 0) {
9771 __pyx_t_16 += __pyx_pybuffernd_colind.diminfo[0].shape;
9772 if (unlikely(__pyx_t_16 < 0)) __pyx_t_28 = 0;
9773 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_28 = 0;
9774 if (unlikely(__pyx_t_28 != -1)) {
9775 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9776 __PYX_ERR(0, 354, __pyx_L1_error)
9778 __pyx_t_1 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_colind.diminfo[0].strides));
9780 if (__pyx_t_1 < 0) {
9781 __pyx_t_1 += __pyx_pybuffernd_gravity.diminfo[0].shape;
9782 if (unlikely(__pyx_t_1 < 0)) __pyx_t_28 = 0;
9783 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_gravity.diminfo[0].shape)) __pyx_t_28 = 0;
9784 if (unlikely(__pyx_t_28 != -1)) {
9785 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9786 __PYX_ERR(0, 354, __pyx_L1_error)
9788 __pyx_t_29 = __pyx_v_eN;
9789 __pyx_t_30 = __pyx_v_ebN;
9790 __pyx_t_31 = __pyx_v_I;
9792 if (__pyx_t_29 < 0) {
9793 __pyx_t_29 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9794 if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
9795 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_28 = 0;
9796 if (__pyx_t_30 < 0) {
9797 __pyx_t_30 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9798 if (unlikely(__pyx_t_30 < 0)) __pyx_t_28 = 1;
9799 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_28 = 1;
9800 if (__pyx_t_31 < 0) {
9801 __pyx_t_31 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9802 if (unlikely(__pyx_t_31 < 0)) __pyx_t_28 = 2;
9803 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_28 = 2;
9804 if (unlikely(__pyx_t_28 != -1)) {
9805 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9806 __PYX_ERR(0, 354, __pyx_L1_error)
9808 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_q_flin.diminfo[2].strides) += ((__pyx_v_rho * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_a_avg.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_gravity.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_gravity.diminfo[0].strides)));
9823 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9826 __Pyx_XDECREF(__pyx_t_3);
9827 __Pyx_XDECREF(__pyx_t_4);
9828 __Pyx_XDECREF(__pyx_t_5);
9829 __Pyx_XDECREF(__pyx_t_6);
9830 __Pyx_XDECREF(__pyx_t_7);
9831 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9832 __Pyx_PyThreadState_declare
9833 __Pyx_PyThreadState_assign
9834 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9835 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9836 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9837 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9838 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9839 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9840 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9841 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9842 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9843 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9844 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9845 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9846 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9847 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
9851 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9852 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9853 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9854 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9855 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9856 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9857 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9858 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9859 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9860 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9861 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9863 __Pyx_XDECREF((PyObject *)__pyx_v_a_eN);
9864 __Pyx_XDECREF((PyObject *)__pyx_v_a_neig);
9865 __Pyx_XDECREF((PyObject *)__pyx_v_a_avg);
9866 __Pyx_XGIVEREF(__pyx_r);
9867 __Pyx_RefNannyFinishContext();
9880 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9881 static char __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM[] =
"\n routine for evaluating nodal coefficients in NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
9882 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM = {
"RE_NCP1_evaluateElementCoefficients_VGM", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM};
9883 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9885 double __pyx_v_beta;
9886 PyArrayObject *__pyx_v_gravity = 0;
9887 PyArrayObject *__pyx_v_alpha = 0;
9888 PyArrayObject *__pyx_v_n = 0;
9889 PyArrayObject *__pyx_v_thetaR = 0;
9890 PyArrayObject *__pyx_v_thetaSR = 0;
9892 int __pyx_v_nElements_global;
9893 int __pyx_v_nElementBoundaries_element;
9894 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
9895 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
9896 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
9897 int __pyx_v_nDOF_trial_element;
9898 PyArrayObject *__pyx_v_u_l2g = 0;
9899 PyArrayObject *__pyx_v_u_dof = 0;
9900 CYTHON_UNUSED PyArrayObject *__pyx_v_q_x = 0;
9901 PyArrayObject *__pyx_v_q_u = 0;
9902 PyArrayObject *__pyx_v_q_mass = 0;
9903 PyArrayObject *__pyx_v_q_dmass = 0;
9904 PyArrayObject *__pyx_v_q_r = 0;
9905 PyArrayObject *__pyx_v_q_kr = 0;
9906 PyArrayObject *__pyx_v_q_dkr = 0;
9907 PyArrayObject *__pyx_v_q_kr_up = 0;
9908 int __pyx_lineno = 0;
9909 const char *__pyx_filename = NULL;
9910 int __pyx_clineno = 0;
9911 PyObject *__pyx_r = 0;
9912 __Pyx_RefNannyDeclarations
9913 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM (wrapper)", 0);
9915 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_beta,&__pyx_n_s_gravity,&__pyx_n_s_alpha,&__pyx_n_s_n,&__pyx_n_s_thetaR,&__pyx_n_s_thetaSR,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_u_l2g,&__pyx_n_s_u_dof,&__pyx_n_s_q_x,&__pyx_n_s_q_u,&__pyx_n_s_q_mass,&__pyx_n_s_q_dmass,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,0};
9916 PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
9917 if (unlikely(__pyx_kwds)) {
9919 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9921 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
9923 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
9925 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
9927 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
9929 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
9931 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
9933 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
9935 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
9937 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
9939 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
9941 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
9943 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
9945 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
9947 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
9949 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
9951 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
9953 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
9955 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
9957 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
9959 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9961 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9963 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9965 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9967 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9970 default:
goto __pyx_L5_argtuple_error;
9972 kw_args = PyDict_Size(__pyx_kwds);
9975 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
9976 else goto __pyx_L5_argtuple_error;
9979 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
9981 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 1); __PYX_ERR(0, 359, __pyx_L3_error)
9985 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
9987 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 2); __PYX_ERR(0, 359, __pyx_L3_error)
9991 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
9993 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 3); __PYX_ERR(0, 359, __pyx_L3_error)
9997 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
9999 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 4); __PYX_ERR(0, 359, __pyx_L3_error)
10001 CYTHON_FALLTHROUGH;
10003 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thetaR)) != 0)) kw_args--;
10005 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 5); __PYX_ERR(0, 359, __pyx_L3_error)
10007 CYTHON_FALLTHROUGH;
10009 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thetaSR)) != 0)) kw_args--;
10011 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 6); __PYX_ERR(0, 359, __pyx_L3_error)
10013 CYTHON_FALLTHROUGH;
10015 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
10017 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 7); __PYX_ERR(0, 359, __pyx_L3_error)
10019 CYTHON_FALLTHROUGH;
10021 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
10023 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 8); __PYX_ERR(0, 359, __pyx_L3_error)
10025 CYTHON_FALLTHROUGH;
10027 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
10029 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 9); __PYX_ERR(0, 359, __pyx_L3_error)
10031 CYTHON_FALLTHROUGH;
10033 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
10035 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 10); __PYX_ERR(0, 359, __pyx_L3_error)
10037 CYTHON_FALLTHROUGH;
10039 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
10041 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 11); __PYX_ERR(0, 359, __pyx_L3_error)
10043 CYTHON_FALLTHROUGH;
10045 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
10047 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 12); __PYX_ERR(0, 359, __pyx_L3_error)
10049 CYTHON_FALLTHROUGH;
10051 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
10053 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 13); __PYX_ERR(0, 359, __pyx_L3_error)
10055 CYTHON_FALLTHROUGH;
10057 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u_l2g)) != 0)) kw_args--;
10059 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 14); __PYX_ERR(0, 359, __pyx_L3_error)
10061 CYTHON_FALLTHROUGH;
10063 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u_dof)) != 0)) kw_args--;
10065 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 15); __PYX_ERR(0, 359, __pyx_L3_error)
10067 CYTHON_FALLTHROUGH;
10069 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_x)) != 0)) kw_args--;
10071 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 16); __PYX_ERR(0, 359, __pyx_L3_error)
10073 CYTHON_FALLTHROUGH;
10075 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
10077 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 17); __PYX_ERR(0, 359, __pyx_L3_error)
10079 CYTHON_FALLTHROUGH;
10081 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mass)) != 0)) kw_args--;
10083 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 18); __PYX_ERR(0, 359, __pyx_L3_error)
10085 CYTHON_FALLTHROUGH;
10087 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dmass)) != 0)) kw_args--;
10089 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 19); __PYX_ERR(0, 359, __pyx_L3_error)
10091 CYTHON_FALLTHROUGH;
10093 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
10095 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 20); __PYX_ERR(0, 359, __pyx_L3_error)
10097 CYTHON_FALLTHROUGH;
10099 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
10101 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 21); __PYX_ERR(0, 359, __pyx_L3_error)
10103 CYTHON_FALLTHROUGH;
10105 if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
10107 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 22); __PYX_ERR(0, 359, __pyx_L3_error)
10109 CYTHON_FALLTHROUGH;
10111 if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
10113 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 23); __PYX_ERR(0, 359, __pyx_L3_error)
10116 if (unlikely(kw_args > 0)) {
10117 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_VGM") < 0)) __PYX_ERR(0, 359, __pyx_L3_error)
10119 }
else if (PyTuple_GET_SIZE(__pyx_args) != 24) {
10120 goto __pyx_L5_argtuple_error;
10122 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10123 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10124 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10125 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10126 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10127 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10128 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10129 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10130 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10131 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10132 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10133 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10134 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10135 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10136 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10137 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10138 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10139 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10140 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10141 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10142 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10143 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
10144 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
10145 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
10147 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error)
10148 __pyx_v_beta = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_beta == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error)
10149 __pyx_v_gravity = ((PyArrayObject *)values[2]);
10150 __pyx_v_alpha = ((PyArrayObject *)values[3]);
10151 __pyx_v_n = ((PyArrayObject *)values[4]);
10152 __pyx_v_thetaR = ((PyArrayObject *)values[5]);
10153 __pyx_v_thetaSR = ((PyArrayObject *)values[6]);
10154 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L3_error)
10155 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
10156 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L3_error)
10157 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[10]);
10158 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[11]);
10159 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[12]);
10160 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[13]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L3_error)
10161 __pyx_v_u_l2g = ((PyArrayObject *)values[14]);
10162 __pyx_v_u_dof = ((PyArrayObject *)values[15]);
10163 __pyx_v_q_x = ((PyArrayObject *)values[16]);
10164 __pyx_v_q_u = ((PyArrayObject *)values[17]);
10165 __pyx_v_q_mass = ((PyArrayObject *)values[18]);
10166 __pyx_v_q_dmass = ((PyArrayObject *)values[19]);
10167 __pyx_v_q_r = ((PyArrayObject *)values[20]);
10168 __pyx_v_q_kr = ((PyArrayObject *)values[21]);
10169 __pyx_v_q_dkr = ((PyArrayObject *)values[22]);
10170 __pyx_v_q_kr_up = ((PyArrayObject *)values[23]);
10172 goto __pyx_L4_argument_unpacking_done;
10173 __pyx_L5_argtuple_error:;
10174 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 359, __pyx_L3_error)
10176 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
10177 __Pyx_RefNannyFinishContext();
10179 __pyx_L4_argument_unpacking_done:;
10180 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 361, __pyx_L1_error)
10181 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alpha), __pyx_ptype_5numpy_ndarray, 1,
"alpha", 0))) __PYX_ERR(0, 362, __pyx_L1_error)
10182 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 363, __pyx_L1_error)
10183 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaR), __pyx_ptype_5numpy_ndarray, 1,
"thetaR", 0))) __PYX_ERR(0, 364, __pyx_L1_error)
10184 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaSR), __pyx_ptype_5numpy_ndarray, 1,
"thetaSR", 0))) __PYX_ERR(0, 365, __pyx_L1_error)
10185 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 370, __pyx_L1_error)
10186 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 371, __pyx_L1_error)
10187 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 372, __pyx_L1_error)
10188 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_l2g), __pyx_ptype_5numpy_ndarray, 1,
"u_l2g", 0))) __PYX_ERR(0, 375, __pyx_L1_error)
10189 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_dof), __pyx_ptype_5numpy_ndarray, 1,
"u_dof", 0))) __PYX_ERR(0, 376, __pyx_L1_error)
10190 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_x), __pyx_ptype_5numpy_ndarray, 1,
"q_x", 0))) __PYX_ERR(0, 378, __pyx_L1_error)
10191 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 379, __pyx_L1_error)
10192 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mass), __pyx_ptype_5numpy_ndarray, 1,
"q_mass", 0))) __PYX_ERR(0, 380, __pyx_L1_error)
10193 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmass), __pyx_ptype_5numpy_ndarray, 1,
"q_dmass", 0))) __PYX_ERR(0, 381, __pyx_L1_error)
10194 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 382, __pyx_L1_error)
10195 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 383, __pyx_L1_error)
10196 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 384, __pyx_L1_error)
10197 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 385, __pyx_L1_error)
10198 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(__pyx_self, __pyx_v_rho, __pyx_v_beta, __pyx_v_gravity, __pyx_v_alpha, __pyx_v_n, __pyx_v_thetaR, __pyx_v_thetaSR, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementMaterialTypes, __pyx_v_nDOF_trial_element, __pyx_v_u_l2g, __pyx_v_u_dof, __pyx_v_q_x, __pyx_v_q_u, __pyx_v_q_mass, __pyx_v_q_dmass, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up);
10205 __Pyx_RefNannyFinishContext();
10209 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up) {
10210 PyObject *__pyx_v_q = NULL;
10211 double __pyx_v_psiC;
10212 double __pyx_v_pcBar;
10213 double __pyx_v_pcBar_n;
10214 double __pyx_v_pcBar_nM1;
10215 double __pyx_v_pcBar_nM2;
10216 double __pyx_v_onePlus_pcBar_n;
10217 double __pyx_v_sBar;
10218 double __pyx_v_sqrt_sBar;
10219 double __pyx_v_DsBar_DpsiC;
10220 double __pyx_v_thetaW;
10221 double __pyx_v_DthetaW_DpsiC;
10222 double __pyx_v_vBar;
10223 double __pyx_v_vBar2;
10224 double __pyx_v_DvBar_DpsiC;
10225 double __pyx_v_KWr;
10226 double __pyx_v_DKWr_DpsiC;
10227 CYTHON_UNUSED
double __pyx_v_rho2;
10228 double __pyx_v_thetaS;
10229 double __pyx_v_rhom;
10230 double __pyx_v_drhom;
10232 double __pyx_v_u_j;
10233 double __pyx_v_u_eN;
10234 double __pyx_v_u_neig;
10235 double __pyx_v_kr_eN;
10236 double __pyx_v_kr_neig;
10237 double __pyx_v_phi_eN;
10238 double __pyx_v_phi_neig;
10240 int __pyx_v_eN_neighbor;
10244 double __pyx_v_nAvgWeight;
10245 __Pyx_LocalBuf_ND __pyx_pybuffernd_alpha;
10246 __Pyx_Buffer __pyx_pybuffer_alpha;
10247 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
10248 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
10249 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
10250 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
10251 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
10252 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
10253 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
10254 __Pyx_Buffer __pyx_pybuffer_gravity;
10255 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
10256 __Pyx_Buffer __pyx_pybuffer_n;
10257 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
10258 __Pyx_Buffer __pyx_pybuffer_q_dkr;
10259 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmass;
10260 __Pyx_Buffer __pyx_pybuffer_q_dmass;
10261 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
10262 __Pyx_Buffer __pyx_pybuffer_q_kr;
10263 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
10264 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
10265 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mass;
10266 __Pyx_Buffer __pyx_pybuffer_q_mass;
10267 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
10268 __Pyx_Buffer __pyx_pybuffer_q_r;
10269 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
10270 __Pyx_Buffer __pyx_pybuffer_q_u;
10271 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_x;
10272 __Pyx_Buffer __pyx_pybuffer_q_x;
10273 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaR;
10274 __Pyx_Buffer __pyx_pybuffer_thetaR;
10275 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaSR;
10276 __Pyx_Buffer __pyx_pybuffer_thetaSR;
10277 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_dof;
10278 __Pyx_Buffer __pyx_pybuffer_u_dof;
10279 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_l2g;
10280 __Pyx_Buffer __pyx_pybuffer_u_l2g;
10281 PyObject *__pyx_r = NULL;
10282 __Pyx_RefNannyDeclarations
10283 PyObject *__pyx_t_1 = NULL;
10284 PyObject *__pyx_t_2 = NULL;
10285 Py_ssize_t __pyx_t_3;
10286 PyObject *__pyx_t_4 = NULL;
10287 PyObject *__pyx_t_5 = NULL;
10293 Py_ssize_t __pyx_t_11;
10297 Py_ssize_t __pyx_t_15;
10299 Py_ssize_t __pyx_t_17;
10300 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_18;
10301 PyObject *__pyx_t_19 = NULL;
10302 PyObject *__pyx_t_20 = NULL;
10303 int __pyx_lineno = 0;
10304 const char *__pyx_filename = NULL;
10305 int __pyx_clineno = 0;
10306 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM", 0);
10307 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
10308 __pyx_pybuffer_gravity.refcount = 0;
10309 __pyx_pybuffernd_gravity.data = NULL;
10310 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
10311 __pyx_pybuffer_alpha.pybuffer.buf = NULL;
10312 __pyx_pybuffer_alpha.refcount = 0;
10313 __pyx_pybuffernd_alpha.data = NULL;
10314 __pyx_pybuffernd_alpha.rcbuffer = &__pyx_pybuffer_alpha;
10315 __pyx_pybuffer_n.pybuffer.buf = NULL;
10316 __pyx_pybuffer_n.refcount = 0;
10317 __pyx_pybuffernd_n.data = NULL;
10318 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
10319 __pyx_pybuffer_thetaR.pybuffer.buf = NULL;
10320 __pyx_pybuffer_thetaR.refcount = 0;
10321 __pyx_pybuffernd_thetaR.data = NULL;
10322 __pyx_pybuffernd_thetaR.rcbuffer = &__pyx_pybuffer_thetaR;
10323 __pyx_pybuffer_thetaSR.pybuffer.buf = NULL;
10324 __pyx_pybuffer_thetaSR.refcount = 0;
10325 __pyx_pybuffernd_thetaSR.data = NULL;
10326 __pyx_pybuffernd_thetaSR.rcbuffer = &__pyx_pybuffer_thetaSR;
10327 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
10328 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
10329 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
10330 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
10331 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
10332 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
10333 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
10334 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
10335 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
10336 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
10337 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
10338 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
10339 __pyx_pybuffer_u_l2g.pybuffer.buf = NULL;
10340 __pyx_pybuffer_u_l2g.refcount = 0;
10341 __pyx_pybuffernd_u_l2g.data = NULL;
10342 __pyx_pybuffernd_u_l2g.rcbuffer = &__pyx_pybuffer_u_l2g;
10343 __pyx_pybuffer_u_dof.pybuffer.buf = NULL;
10344 __pyx_pybuffer_u_dof.refcount = 0;
10345 __pyx_pybuffernd_u_dof.data = NULL;
10346 __pyx_pybuffernd_u_dof.rcbuffer = &__pyx_pybuffer_u_dof;
10347 __pyx_pybuffer_q_x.pybuffer.buf = NULL;
10348 __pyx_pybuffer_q_x.refcount = 0;
10349 __pyx_pybuffernd_q_x.data = NULL;
10350 __pyx_pybuffernd_q_x.rcbuffer = &__pyx_pybuffer_q_x;
10351 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
10352 __pyx_pybuffer_q_u.refcount = 0;
10353 __pyx_pybuffernd_q_u.data = NULL;
10354 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
10355 __pyx_pybuffer_q_mass.pybuffer.buf = NULL;
10356 __pyx_pybuffer_q_mass.refcount = 0;
10357 __pyx_pybuffernd_q_mass.data = NULL;
10358 __pyx_pybuffernd_q_mass.rcbuffer = &__pyx_pybuffer_q_mass;
10359 __pyx_pybuffer_q_dmass.pybuffer.buf = NULL;
10360 __pyx_pybuffer_q_dmass.refcount = 0;
10361 __pyx_pybuffernd_q_dmass.data = NULL;
10362 __pyx_pybuffernd_q_dmass.rcbuffer = &__pyx_pybuffer_q_dmass;
10363 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
10364 __pyx_pybuffer_q_r.refcount = 0;
10365 __pyx_pybuffernd_q_r.data = NULL;
10366 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
10367 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
10368 __pyx_pybuffer_q_kr.refcount = 0;
10369 __pyx_pybuffernd_q_kr.data = NULL;
10370 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
10371 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
10372 __pyx_pybuffer_q_dkr.refcount = 0;
10373 __pyx_pybuffernd_q_dkr.data = NULL;
10374 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
10375 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
10376 __pyx_pybuffer_q_kr_up.refcount = 0;
10377 __pyx_pybuffernd_q_kr_up.data = NULL;
10378 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
10380 __Pyx_BufFmt_StackElem __pyx_stack[1];
10381 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10383 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
10385 __Pyx_BufFmt_StackElem __pyx_stack[1];
10386 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10388 __pyx_pybuffernd_alpha.diminfo[0].strides = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha.diminfo[0].shape = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.shape[0];
10390 __Pyx_BufFmt_StackElem __pyx_stack[1];
10391 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10393 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0];
10395 __Pyx_BufFmt_StackElem __pyx_stack[1];
10396 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10398 __pyx_pybuffernd_thetaR.diminfo[0].strides = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaR.diminfo[0].shape = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.shape[0];
10400 __Pyx_BufFmt_StackElem __pyx_stack[1];
10401 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaSR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10403 __pyx_pybuffernd_thetaSR.diminfo[0].strides = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaSR.diminfo[0].shape = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.shape[0];
10405 __Pyx_BufFmt_StackElem __pyx_stack[1];
10406 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10408 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
10410 __Pyx_BufFmt_StackElem __pyx_stack[1];
10411 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10413 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
10415 __Pyx_BufFmt_StackElem __pyx_stack[1];
10416 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10418 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
10420 __Pyx_BufFmt_StackElem __pyx_stack[1];
10421 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10423 __pyx_pybuffernd_u_l2g.diminfo[0].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_l2g.diminfo[0].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_u_l2g.diminfo[1].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_u_l2g.diminfo[1].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[1];
10425 __Pyx_BufFmt_StackElem __pyx_stack[1];
10426 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_dof, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10428 __pyx_pybuffernd_u_dof.diminfo[0].strides = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_dof.diminfo[0].shape = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.shape[0];
10430 __Pyx_BufFmt_StackElem __pyx_stack[1];
10431 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10433 __pyx_pybuffernd_q_x.diminfo[0].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_x.diminfo[0].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_x.diminfo[1].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_x.diminfo[1].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_x.diminfo[2].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_x.diminfo[2].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[2];
10435 __Pyx_BufFmt_StackElem __pyx_stack[1];
10436 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10438 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
10440 __Pyx_BufFmt_StackElem __pyx_stack[1];
10441 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10443 __pyx_pybuffernd_q_mass.diminfo[0].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mass.diminfo[0].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mass.diminfo[1].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mass.diminfo[1].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[1];
10445 __Pyx_BufFmt_StackElem __pyx_stack[1];
10446 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10448 __pyx_pybuffernd_q_dmass.diminfo[0].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmass.diminfo[0].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmass.diminfo[1].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmass.diminfo[1].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[1];
10450 __Pyx_BufFmt_StackElem __pyx_stack[1];
10451 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10453 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
10455 __Pyx_BufFmt_StackElem __pyx_stack[1];
10456 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10458 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
10460 __Pyx_BufFmt_StackElem __pyx_stack[1];
10461 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10463 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
10465 __Pyx_BufFmt_StackElem __pyx_stack[1];
10466 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10468 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
10477 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
10478 __Pyx_GOTREF(__pyx_t_1);
10479 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
10480 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
10481 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
10482 __Pyx_INCREF(((PyObject *)__pyx_v_q_mass));
10483 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mass));
10484 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_mass));
10485 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
10486 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
10487 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_r));
10488 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
10489 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
10490 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_kr));
10491 __Pyx_INCREF(((PyObject *)__pyx_v_q_dkr));
10492 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_dkr));
10493 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_dkr));
10494 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10495 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10497 if (__pyx_t_3 >= 5)
break;
10498 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10499 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
10501 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
10502 __Pyx_GOTREF(__pyx_t_1);
10504 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
10514 #ifndef CYTHON_WITHOUT_ASSERTIONS
10515 if (unlikely(!Py_OptimizeFlag)) {
10516 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
10517 __Pyx_GOTREF(__pyx_t_1);
10518 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
10519 __Pyx_GOTREF(__pyx_t_4);
10520 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10521 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
10522 __Pyx_GOTREF(__pyx_t_1);
10523 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
10524 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10525 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10526 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
10527 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10528 if (unlikely(!__pyx_t_6)) {
10529 PyErr_SetNone(PyExc_AssertionError);
10530 __PYX_ERR(0, 400, __pyx_L1_error)
10543 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10552 #ifndef CYTHON_WITHOUT_ASSERTIONS
10553 if (unlikely(!Py_OptimizeFlag)) {
10554 if (unlikely(!((__pyx_v_nDOF_trial_element == (__pyx_v_nSpace + 1)) != 0))) {
10555 PyErr_SetNone(PyExc_AssertionError);
10556 __PYX_ERR(0, 401, __pyx_L1_error)
10568 __pyx_v_rho2 = (__pyx_v_rho * __pyx_v_rho);
10577 __pyx_t_7 = (__pyx_v_nSpace + 1.);
10578 if (unlikely(__pyx_t_7 == 0)) {
10579 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10580 __PYX_ERR(0, 409, __pyx_L1_error)
10582 __pyx_v_nAvgWeight = (1.0 / __pyx_t_7);
10591 __pyx_t_8 = __pyx_v_nElements_global;
10592 __pyx_t_9 = __pyx_t_8;
10593 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
10594 __pyx_v_eN = __pyx_t_10;
10603 __pyx_t_11 = __pyx_v_eN;
10605 if (__pyx_t_11 < 0) {
10606 __pyx_t_11 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
10607 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
10608 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_12 = 0;
10609 if (unlikely(__pyx_t_12 != -1)) {
10610 __Pyx_RaiseBufferIndexError(__pyx_t_12);
10611 __PYX_ERR(0, 413, __pyx_L1_error)
10613 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
10622 __pyx_t_12 = __pyx_v_nDOF_trial_element;
10623 __pyx_t_13 = __pyx_t_12;
10624 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
10625 __pyx_v_j = __pyx_t_14;
10634 __pyx_t_11 = __pyx_v_eN;
10635 __pyx_t_15 = __pyx_v_j;
10637 if (__pyx_t_11 < 0) {
10638 __pyx_t_11 += __pyx_pybuffernd_u_l2g.diminfo[0].shape;
10639 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10640 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_u_l2g.diminfo[0].shape)) __pyx_t_16 = 0;
10641 if (__pyx_t_15 < 0) {
10642 __pyx_t_15 += __pyx_pybuffernd_u_l2g.diminfo[1].shape;
10643 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
10644 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_u_l2g.diminfo[1].shape)) __pyx_t_16 = 1;
10645 if (unlikely(__pyx_t_16 != -1)) {
10646 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10647 __PYX_ERR(0, 415, __pyx_L1_error)
10649 __pyx_t_17 = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_u_l2g.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_u_l2g.diminfo[1].strides));
10651 if (__pyx_t_17 < 0) {
10652 __pyx_t_17 += __pyx_pybuffernd_u_dof.diminfo[0].shape;
10653 if (unlikely(__pyx_t_17 < 0)) __pyx_t_16 = 0;
10654 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_u_dof.diminfo[0].shape)) __pyx_t_16 = 0;
10655 if (unlikely(__pyx_t_16 != -1)) {
10656 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10657 __PYX_ERR(0, 415, __pyx_L1_error)
10659 __pyx_v_u_j = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_u_dof.diminfo[0].strides));
10668 __pyx_t_15 = __pyx_v_eN;
10669 __pyx_t_11 = __pyx_v_j;
10671 if (__pyx_t_15 < 0) {
10672 __pyx_t_15 += __pyx_pybuffernd_q_u.diminfo[0].shape;
10673 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10674 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_u.diminfo[0].shape)) __pyx_t_16 = 0;
10675 if (__pyx_t_11 < 0) {
10676 __pyx_t_11 += __pyx_pybuffernd_q_u.diminfo[1].shape;
10677 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
10678 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_u.diminfo[1].shape)) __pyx_t_16 = 1;
10679 if (unlikely(__pyx_t_16 != -1)) {
10680 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10681 __PYX_ERR(0, 416, __pyx_L1_error)
10683 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_u.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_u.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_u.diminfo[1].strides) = __pyx_v_u_j;
10692 __pyx_v_psiC = (-__pyx_v_u_j);
10701 __pyx_t_11 = __pyx_v_matID;
10703 if (__pyx_t_11 < 0) {
10704 __pyx_t_11 += __pyx_pybuffernd_n.diminfo[0].shape;
10705 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10706 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10707 if (unlikely(__pyx_t_16 != -1)) {
10708 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10709 __PYX_ERR(0, 420, __pyx_L1_error)
10711 __pyx_t_18 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_n.diminfo[0].strides));
10712 if (unlikely(__pyx_t_18 == 0)) {
10713 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10714 __PYX_ERR(0, 420, __pyx_L1_error)
10716 __pyx_v_m = (1.0 - (1.0 / __pyx_t_18));
10725 __pyx_t_11 = __pyx_v_matID;
10727 if (__pyx_t_11 < 0) {
10728 __pyx_t_11 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
10729 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10730 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_16 = 0;
10731 if (unlikely(__pyx_t_16 != -1)) {
10732 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10733 __PYX_ERR(0, 421, __pyx_L1_error)
10735 __pyx_t_15 = __pyx_v_matID;
10737 if (__pyx_t_15 < 0) {
10738 __pyx_t_15 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10739 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10740 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_16 = 0;
10741 if (unlikely(__pyx_t_16 != -1)) {
10742 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10743 __PYX_ERR(0, 421, __pyx_L1_error)
10745 __pyx_v_thetaS = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_thetaR.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_thetaSR.diminfo[0].strides)));
10754 __pyx_t_6 = ((__pyx_v_psiC > 0.0) != 0);
10764 __pyx_t_15 = __pyx_v_matID;
10766 if (__pyx_t_15 < 0) {
10767 __pyx_t_15 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10768 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10769 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_16 = 0;
10770 if (unlikely(__pyx_t_16 != -1)) {
10771 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10772 __PYX_ERR(0, 423, __pyx_L1_error)
10774 __pyx_v_pcBar = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_alpha.diminfo[0].strides)) * __pyx_v_psiC);
10783 __pyx_t_15 = __pyx_v_matID;
10785 if (__pyx_t_15 < 0) {
10786 __pyx_t_15 += __pyx_pybuffernd_n.diminfo[0].shape;
10787 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10788 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10789 if (unlikely(__pyx_t_16 != -1)) {
10790 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10791 __PYX_ERR(0, 424, __pyx_L1_error)
10793 __pyx_v_pcBar_nM2 = pow(__pyx_v_pcBar, ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_n.diminfo[0].strides)) - 2.0));
10802 __pyx_v_pcBar_nM1 = (__pyx_v_pcBar_nM2 * __pyx_v_pcBar);
10811 __pyx_v_pcBar_n = (__pyx_v_pcBar_nM1 * __pyx_v_pcBar);
10820 __pyx_v_onePlus_pcBar_n = (1.0 + __pyx_v_pcBar_n);
10829 __pyx_v_sBar = pow(__pyx_v_onePlus_pcBar_n, (-__pyx_v_m));
10838 __pyx_t_15 = __pyx_v_matID;
10840 if (__pyx_t_15 < 0) {
10841 __pyx_t_15 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10842 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10843 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_16 = 0;
10844 if (unlikely(__pyx_t_16 != -1)) {
10845 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10846 __PYX_ERR(0, 431, __pyx_L1_error)
10848 __pyx_t_11 = __pyx_v_matID;
10850 if (__pyx_t_11 < 0) {
10851 __pyx_t_11 += __pyx_pybuffernd_n.diminfo[0].shape;
10852 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10853 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10854 if (unlikely(__pyx_t_16 != -1)) {
10855 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10856 __PYX_ERR(0, 431, __pyx_L1_error)
10858 if (unlikely(__pyx_v_onePlus_pcBar_n == 0)) {
10859 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10860 __PYX_ERR(0, 431, __pyx_L1_error)
10862 __pyx_v_DsBar_DpsiC = ((((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_alpha.diminfo[0].strides)) * (1.0 - (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_n.diminfo[0].strides)))) * (__pyx_v_sBar / __pyx_v_onePlus_pcBar_n)) * __pyx_v_pcBar_nM1);
10871 __pyx_v_vBar = (1.0 - (__pyx_v_pcBar_nM1 * __pyx_v_sBar));
10880 __pyx_v_vBar2 = (__pyx_v_vBar * __pyx_v_vBar);
10889 __pyx_t_11 = __pyx_v_matID;
10891 if (__pyx_t_11 < 0) {
10892 __pyx_t_11 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10893 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10894 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_16 = 0;
10895 if (unlikely(__pyx_t_16 != -1)) {
10896 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10897 __PYX_ERR(0, 435, __pyx_L1_error)
10899 __pyx_t_15 = __pyx_v_matID;
10901 if (__pyx_t_15 < 0) {
10902 __pyx_t_15 += __pyx_pybuffernd_n.diminfo[0].shape;
10903 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10904 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10905 if (unlikely(__pyx_t_16 != -1)) {
10906 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10907 __PYX_ERR(0, 435, __pyx_L1_error)
10909 __pyx_v_DvBar_DpsiC = (((((-(*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_alpha.diminfo[0].strides))) * ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_n.diminfo[0].strides)) - 1.0)) * __pyx_v_pcBar_nM2) * __pyx_v_sBar) - (__pyx_v_pcBar_nM1 * __pyx_v_DsBar_DpsiC));
10918 __pyx_t_15 = __pyx_v_matID;
10920 if (__pyx_t_15 < 0) {
10921 __pyx_t_15 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10922 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10923 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_16 = 0;
10924 if (unlikely(__pyx_t_16 != -1)) {
10925 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10926 __PYX_ERR(0, 437, __pyx_L1_error)
10928 __pyx_t_11 = __pyx_v_matID;
10930 if (__pyx_t_11 < 0) {
10931 __pyx_t_11 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
10932 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10933 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_16 = 0;
10934 if (unlikely(__pyx_t_16 != -1)) {
10935 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10936 __PYX_ERR(0, 437, __pyx_L1_error)
10938 __pyx_v_thetaW = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_sBar) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_thetaR.diminfo[0].strides)));
10947 __pyx_t_11 = __pyx_v_matID;
10949 if (__pyx_t_11 < 0) {
10950 __pyx_t_11 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10951 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10952 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_16 = 0;
10953 if (unlikely(__pyx_t_16 != -1)) {
10954 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10955 __PYX_ERR(0, 438, __pyx_L1_error)
10957 __pyx_v_DthetaW_DpsiC = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_DsBar_DpsiC);
10966 __pyx_v_sqrt_sBar = sqrt(__pyx_v_sBar);
10975 __pyx_v_KWr = (__pyx_v_sqrt_sBar * __pyx_v_vBar2);
10984 if (unlikely(__pyx_v_sqrt_sBar == 0)) {
10985 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10986 __PYX_ERR(0, 442, __pyx_L1_error)
10988 __pyx_v_DKWr_DpsiC = ((((0.5 / __pyx_v_sqrt_sBar) * __pyx_v_DsBar_DpsiC) * __pyx_v_vBar2) + (((2.0 * __pyx_v_sqrt_sBar) * __pyx_v_vBar) * __pyx_v_DvBar_DpsiC));
11008 __pyx_v_thetaW = __pyx_v_thetaS;
11017 __pyx_v_DthetaW_DpsiC = 0.0;
11035 __pyx_v_DKWr_DpsiC = 0.0;
11046 __pyx_v_rhom = (__pyx_v_rho * exp((__pyx_v_beta * __pyx_v_u_j)));
11055 __pyx_v_drhom = (__pyx_v_beta * __pyx_v_rhom);
11064 __pyx_t_11 = __pyx_v_eN;
11065 __pyx_t_15 = __pyx_v_j;
11067 if (__pyx_t_11 < 0) {
11068 __pyx_t_11 += __pyx_pybuffernd_q_mass.diminfo[0].shape;
11069 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11070 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_mass.diminfo[0].shape)) __pyx_t_16 = 0;
11071 if (__pyx_t_15 < 0) {
11072 __pyx_t_15 += __pyx_pybuffernd_q_mass.diminfo[1].shape;
11073 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11074 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_mass.diminfo[1].shape)) __pyx_t_16 = 1;
11075 if (unlikely(__pyx_t_16 != -1)) {
11076 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11077 __PYX_ERR(0, 451, __pyx_L1_error)
11079 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_mass.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_mass.diminfo[1].strides) = (__pyx_v_rhom * __pyx_v_thetaW);
11088 __pyx_t_15 = __pyx_v_eN;
11089 __pyx_t_11 = __pyx_v_j;
11091 if (__pyx_t_15 < 0) {
11092 __pyx_t_15 += __pyx_pybuffernd_q_dmass.diminfo[0].shape;
11093 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
11094 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_dmass.diminfo[0].shape)) __pyx_t_16 = 0;
11095 if (__pyx_t_11 < 0) {
11096 __pyx_t_11 += __pyx_pybuffernd_q_dmass.diminfo[1].shape;
11097 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
11098 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_dmass.diminfo[1].shape)) __pyx_t_16 = 1;
11099 if (unlikely(__pyx_t_16 != -1)) {
11100 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11101 __PYX_ERR(0, 452, __pyx_L1_error)
11103 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_dmass.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_dmass.diminfo[1].strides) = (((-__pyx_v_rhom) * __pyx_v_DthetaW_DpsiC) + (__pyx_v_drhom * __pyx_v_thetaW));
11112 __pyx_t_11 = __pyx_v_eN;
11113 __pyx_t_15 = __pyx_v_j;
11115 if (__pyx_t_11 < 0) {
11116 __pyx_t_11 += __pyx_pybuffernd_q_kr.diminfo[0].shape;
11117 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11118 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_kr.diminfo[0].shape)) __pyx_t_16 = 0;
11119 if (__pyx_t_15 < 0) {
11120 __pyx_t_15 += __pyx_pybuffernd_q_kr.diminfo[1].shape;
11121 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11122 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr.diminfo[1].shape)) __pyx_t_16 = 1;
11123 if (unlikely(__pyx_t_16 != -1)) {
11124 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11125 __PYX_ERR(0, 454, __pyx_L1_error)
11127 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_kr.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr.diminfo[1].strides) = __pyx_v_KWr;
11136 __pyx_t_15 = __pyx_v_eN;
11137 __pyx_t_11 = __pyx_v_j;
11139 if (__pyx_t_15 < 0) {
11140 __pyx_t_15 += __pyx_pybuffernd_q_dkr.diminfo[0].shape;
11141 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
11142 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_dkr.diminfo[0].shape)) __pyx_t_16 = 0;
11143 if (__pyx_t_11 < 0) {
11144 __pyx_t_11 += __pyx_pybuffernd_q_dkr.diminfo[1].shape;
11145 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
11146 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_dkr.diminfo[1].shape)) __pyx_t_16 = 1;
11147 if (unlikely(__pyx_t_16 != -1)) {
11148 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11149 __PYX_ERR(0, 455, __pyx_L1_error)
11151 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_dkr.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_dkr.diminfo[1].strides) = (-__pyx_v_DKWr_DpsiC);
11162 __pyx_t_8 = __pyx_v_nElements_global;
11163 __pyx_t_9 = __pyx_t_8;
11164 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
11165 __pyx_v_eN = __pyx_t_10;
11174 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11175 __Pyx_GOTREF(__pyx_t_5);
11176 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
11177 __Pyx_GOTREF(__pyx_t_1);
11178 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11179 __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11180 __Pyx_GOTREF(__pyx_t_5);
11182 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11183 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
11184 if (likely(__pyx_t_4)) {
11185 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11186 __Pyx_INCREF(__pyx_t_4);
11187 __Pyx_INCREF(
function);
11188 __Pyx_DECREF_SET(__pyx_t_1,
function);
11191 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
11192 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11193 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11194 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
11195 __Pyx_GOTREF(__pyx_t_2);
11196 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11197 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
11198 __Pyx_GOTREF(__pyx_t_1);
11199 __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11200 __Pyx_GOTREF(__pyx_t_5);
11201 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11202 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11203 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error)
11204 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11205 __pyx_v_u_eN = __pyx_t_7;
11214 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11215 __Pyx_GOTREF(__pyx_t_1);
11216 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
11217 __Pyx_GOTREF(__pyx_t_2);
11218 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11219 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11220 __Pyx_GOTREF(__pyx_t_1);
11222 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11223 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
11224 if (likely(__pyx_t_4)) {
11225 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11226 __Pyx_INCREF(__pyx_t_4);
11227 __Pyx_INCREF(
function);
11228 __Pyx_DECREF_SET(__pyx_t_2,
function);
11231 __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
11232 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11233 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11234 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
11235 __Pyx_GOTREF(__pyx_t_5);
11236 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11237 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
11238 __Pyx_GOTREF(__pyx_t_2);
11239 __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11240 __Pyx_GOTREF(__pyx_t_1);
11241 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11242 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11243 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error)
11244 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11245 __pyx_v_kr_eN = __pyx_t_7;
11254 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_u_eN);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
11255 __Pyx_GOTREF(__pyx_t_1);
11256 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
11257 __Pyx_GOTREF(__pyx_t_5);
11258 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dot);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
11259 __Pyx_GOTREF(__pyx_t_4);
11260 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11261 __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
11262 __Pyx_GOTREF(__pyx_t_5);
11265 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11266 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_4);
11267 if (likely(__pyx_t_19)) {
11268 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
11269 __Pyx_INCREF(__pyx_t_19);
11270 __Pyx_INCREF(
function);
11271 __Pyx_DECREF_SET(__pyx_t_4,
function);
11275 #if CYTHON_FAST_PYCALL
11276 if (PyFunction_Check(__pyx_t_4)) {
11277 PyObject *__pyx_temp[3] = {__pyx_t_19, ((PyObject *)__pyx_v_gravity), __pyx_t_5};
11278 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11279 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
11280 __Pyx_GOTREF(__pyx_t_2);
11281 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11284 #if CYTHON_FAST_PYCCALL
11285 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
11286 PyObject *__pyx_temp[3] = {__pyx_t_19, ((PyObject *)__pyx_v_gravity), __pyx_t_5};
11287 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11288 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
11289 __Pyx_GOTREF(__pyx_t_2);
11290 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11294 __pyx_t_20 = PyTuple_New(2+__pyx_t_12);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 465, __pyx_L1_error)
11295 __Pyx_GOTREF(__pyx_t_20);
11297 __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __pyx_t_19 = NULL;
11299 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
11300 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
11301 PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_12, ((PyObject *)__pyx_v_gravity));
11302 __Pyx_GIVEREF(__pyx_t_5);
11303 PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_12, __pyx_t_5);
11305 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11306 __Pyx_GOTREF(__pyx_t_2);
11307 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11309 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11310 __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
11311 __Pyx_GOTREF(__pyx_t_4);
11312 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11313 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11314 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error)
11315 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11316 __pyx_v_phi_eN = __pyx_t_7;
11325 __pyx_t_12 = __pyx_v_nElementBoundaries_element;
11326 __pyx_t_13 = __pyx_t_12;
11327 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
11328 __pyx_v_ebN = __pyx_t_14;
11337 __pyx_t_11 = __pyx_v_eN;
11338 __pyx_t_15 = __pyx_v_ebN;
11340 if (__pyx_t_11 < 0) {
11341 __pyx_t_11 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11342 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11343 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_16 = 0;
11344 if (__pyx_t_15 < 0) {
11345 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11346 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11347 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_16 = 1;
11348 if (unlikely(__pyx_t_16 != -1)) {
11349 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11350 __PYX_ERR(0, 471, __pyx_L1_error)
11352 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_eN;
11361 __pyx_t_15 = __pyx_v_eN;
11362 __pyx_t_11 = __pyx_v_ebN;
11364 if (__pyx_t_15 < 0) {
11365 __pyx_t_15 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
11366 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
11367 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_16 = 0;
11368 if (__pyx_t_11 < 0) {
11369 __pyx_t_11 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
11370 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
11371 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_16 = 1;
11372 if (unlikely(__pyx_t_16 != -1)) {
11373 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11374 __PYX_ERR(0, 472, __pyx_L1_error)
11376 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
11385 __pyx_t_6 = ((__pyx_v_eN_neighbor >= 0) != 0);
11395 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11396 __Pyx_GOTREF(__pyx_t_2);
11397 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11398 __Pyx_GOTREF(__pyx_t_1);
11399 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11400 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11401 __Pyx_GOTREF(__pyx_t_2);
11403 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11404 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1);
11405 if (likely(__pyx_t_20)) {
11406 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11407 __Pyx_INCREF(__pyx_t_20);
11408 __Pyx_INCREF(
function);
11409 __Pyx_DECREF_SET(__pyx_t_1,
function);
11412 __pyx_t_4 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_20, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
11413 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
11414 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11415 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
11416 __Pyx_GOTREF(__pyx_t_4);
11417 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11418 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11419 __Pyx_GOTREF(__pyx_t_1);
11420 __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11421 __Pyx_GOTREF(__pyx_t_2);
11422 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11423 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11424 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L1_error)
11425 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11426 __pyx_v_u_neig = __pyx_t_7;
11435 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11436 __Pyx_GOTREF(__pyx_t_1);
11437 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
11438 __Pyx_GOTREF(__pyx_t_4);
11439 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11440 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11441 __Pyx_GOTREF(__pyx_t_1);
11443 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11444 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_4);
11445 if (likely(__pyx_t_20)) {
11446 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
11447 __Pyx_INCREF(__pyx_t_20);
11448 __Pyx_INCREF(
function);
11449 __Pyx_DECREF_SET(__pyx_t_4,
function);
11452 __pyx_t_2 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_20, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1);
11453 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
11454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11455 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
11456 __Pyx_GOTREF(__pyx_t_2);
11457 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11458 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
11459 __Pyx_GOTREF(__pyx_t_4);
11460 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11461 __Pyx_GOTREF(__pyx_t_1);
11462 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11463 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11464 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error)
11465 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11466 __pyx_v_kr_neig = __pyx_t_7;
11475 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_u_neig);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11476 __Pyx_GOTREF(__pyx_t_1);
11477 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
11478 __Pyx_GOTREF(__pyx_t_2);
11479 __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dot);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 477, __pyx_L1_error)
11480 __Pyx_GOTREF(__pyx_t_20);
11481 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11482 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
11483 __Pyx_GOTREF(__pyx_t_2);
11486 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
11487 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_20);
11488 if (likely(__pyx_t_5)) {
11489 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_20);
11490 __Pyx_INCREF(__pyx_t_5);
11491 __Pyx_INCREF(
function);
11492 __Pyx_DECREF_SET(__pyx_t_20,
function);
11496 #if CYTHON_FAST_PYCALL
11497 if (PyFunction_Check(__pyx_t_20)) {
11498 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_2};
11499 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11500 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11501 __Pyx_GOTREF(__pyx_t_4);
11502 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11505 #if CYTHON_FAST_PYCCALL
11506 if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
11507 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_2};
11508 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11509 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11510 __Pyx_GOTREF(__pyx_t_4);
11511 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11515 __pyx_t_19 = PyTuple_New(2+__pyx_t_16);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 477, __pyx_L1_error)
11516 __Pyx_GOTREF(__pyx_t_19);
11518 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_5); __pyx_t_5 = NULL;
11520 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
11521 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
11522 PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_16, ((PyObject *)__pyx_v_gravity));
11523 __Pyx_GIVEREF(__pyx_t_2);
11524 PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_16, __pyx_t_2);
11526 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11527 __Pyx_GOTREF(__pyx_t_4);
11528 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
11530 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11531 __pyx_t_20 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 477, __pyx_L1_error)
11532 __Pyx_GOTREF(__pyx_t_20);
11533 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11534 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11535 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_20);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L1_error)
11536 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11537 __pyx_v_phi_neig = __pyx_t_7;
11546 __pyx_t_6 = ((__pyx_v_phi_eN < __pyx_v_phi_neig) != 0);
11556 __pyx_t_11 = __pyx_v_eN;
11557 __pyx_t_15 = __pyx_v_ebN;
11559 if (__pyx_t_11 < 0) {
11560 __pyx_t_11 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11561 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11562 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_16 = 0;
11563 if (__pyx_t_15 < 0) {
11564 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11565 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11566 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_16 = 1;
11567 if (unlikely(__pyx_t_16 != -1)) {
11568 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11569 __PYX_ERR(0, 480, __pyx_L1_error)
11571 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_neig;
11602 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11605 __Pyx_XDECREF(__pyx_t_1);
11606 __Pyx_XDECREF(__pyx_t_2);
11607 __Pyx_XDECREF(__pyx_t_4);
11608 __Pyx_XDECREF(__pyx_t_5);
11609 __Pyx_XDECREF(__pyx_t_19);
11610 __Pyx_XDECREF(__pyx_t_20);
11611 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11612 __Pyx_PyThreadState_declare
11613 __Pyx_PyThreadState_assign
11614 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11615 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11616 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11617 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11618 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11619 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11620 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11621 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11622 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11623 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11624 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11625 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11626 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11627 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11628 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11629 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11630 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11631 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11632 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11633 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11634 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
11638 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11639 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11640 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11641 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11642 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11643 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11644 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11645 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11646 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11647 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11648 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11649 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11650 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11651 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11652 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11653 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11654 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11655 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11657 __Pyx_XDECREF(__pyx_v_q);
11658 __Pyx_XGIVEREF(__pyx_r);
11659 __Pyx_RefNannyFinishContext();
11672 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11673 static char __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
11674 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual = {
"RE_NCP1_getElementResidual", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual};
11675 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11676 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
11677 PyArrayObject *__pyx_v_rowptr = 0;
11678 PyArrayObject *__pyx_v_colind = 0;
11679 int __pyx_v_nSpace;
11680 int __pyx_v_nElements_global;
11681 int __pyx_v_nElementBoundaries_element;
11682 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
11683 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
11684 int __pyx_v_nDOF_test_element;
11685 PyArrayObject *__pyx_v_q_u = 0;
11686 PyArrayObject *__pyx_v_q_grad_u = 0;
11687 PyArrayObject *__pyx_v_q_grad_w = 0;
11688 PyArrayObject *__pyx_v_q_detJ = 0;
11689 PyArrayObject *__pyx_v_q_m = 0;
11690 PyArrayObject *__pyx_v_q_mt = 0;
11691 PyArrayObject *__pyx_v_q_r = 0;
11692 PyArrayObject *__pyx_v_q_kr = 0;
11693 PyArrayObject *__pyx_v_q_kr_up = 0;
11694 PyArrayObject *__pyx_v_q_flin = 0;
11695 PyArrayObject *__pyx_v_q_alin = 0;
11696 PyArrayObject *__pyx_v_elementResidual = 0;
11697 int __pyx_lineno = 0;
11698 const char *__pyx_filename = NULL;
11699 int __pyx_clineno = 0;
11700 PyObject *__pyx_r = 0;
11701 __Pyx_RefNannyDeclarations
11702 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual (wrapper)", 0);
11704 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_mt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementResidual,0};
11705 PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
11706 if (unlikely(__pyx_kwds)) {
11707 Py_ssize_t kw_args;
11708 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11709 switch (pos_args) {
11710 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11711 CYTHON_FALLTHROUGH;
11712 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11713 CYTHON_FALLTHROUGH;
11714 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11715 CYTHON_FALLTHROUGH;
11716 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11717 CYTHON_FALLTHROUGH;
11718 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11719 CYTHON_FALLTHROUGH;
11720 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11721 CYTHON_FALLTHROUGH;
11722 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11723 CYTHON_FALLTHROUGH;
11724 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11725 CYTHON_FALLTHROUGH;
11726 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11727 CYTHON_FALLTHROUGH;
11728 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11729 CYTHON_FALLTHROUGH;
11730 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11731 CYTHON_FALLTHROUGH;
11732 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11733 CYTHON_FALLTHROUGH;
11734 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11735 CYTHON_FALLTHROUGH;
11736 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11737 CYTHON_FALLTHROUGH;
11738 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11739 CYTHON_FALLTHROUGH;
11740 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11741 CYTHON_FALLTHROUGH;
11742 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11743 CYTHON_FALLTHROUGH;
11744 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11745 CYTHON_FALLTHROUGH;
11746 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11747 CYTHON_FALLTHROUGH;
11748 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11749 CYTHON_FALLTHROUGH;
11750 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11751 CYTHON_FALLTHROUGH;
11753 default:
goto __pyx_L5_argtuple_error;
11755 kw_args = PyDict_Size(__pyx_kwds);
11756 switch (pos_args) {
11758 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
11759 else goto __pyx_L5_argtuple_error;
11760 CYTHON_FALLTHROUGH;
11762 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
11764 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 1); __PYX_ERR(0, 486, __pyx_L3_error)
11766 CYTHON_FALLTHROUGH;
11768 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
11770 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 2); __PYX_ERR(0, 486, __pyx_L3_error)
11772 CYTHON_FALLTHROUGH;
11774 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
11776 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 3); __PYX_ERR(0, 486, __pyx_L3_error)
11778 CYTHON_FALLTHROUGH;
11780 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
11782 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 4); __PYX_ERR(0, 486, __pyx_L3_error)
11784 CYTHON_FALLTHROUGH;
11786 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
11788 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 5); __PYX_ERR(0, 486, __pyx_L3_error)
11790 CYTHON_FALLTHROUGH;
11792 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
11794 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 6); __PYX_ERR(0, 486, __pyx_L3_error)
11796 CYTHON_FALLTHROUGH;
11798 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
11800 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 7); __PYX_ERR(0, 486, __pyx_L3_error)
11802 CYTHON_FALLTHROUGH;
11804 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
11806 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 8); __PYX_ERR(0, 486, __pyx_L3_error)
11808 CYTHON_FALLTHROUGH;
11810 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
11812 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 9); __PYX_ERR(0, 486, __pyx_L3_error)
11814 CYTHON_FALLTHROUGH;
11816 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
11818 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 10); __PYX_ERR(0, 486, __pyx_L3_error)
11820 CYTHON_FALLTHROUGH;
11822 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
11824 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 11); __PYX_ERR(0, 486, __pyx_L3_error)
11826 CYTHON_FALLTHROUGH;
11828 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
11830 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 12); __PYX_ERR(0, 486, __pyx_L3_error)
11832 CYTHON_FALLTHROUGH;
11834 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
11836 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 13); __PYX_ERR(0, 486, __pyx_L3_error)
11838 CYTHON_FALLTHROUGH;
11840 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
11842 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 14); __PYX_ERR(0, 486, __pyx_L3_error)
11844 CYTHON_FALLTHROUGH;
11846 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
11848 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 15); __PYX_ERR(0, 486, __pyx_L3_error)
11850 CYTHON_FALLTHROUGH;
11852 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
11854 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 16); __PYX_ERR(0, 486, __pyx_L3_error)
11856 CYTHON_FALLTHROUGH;
11858 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
11860 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 17); __PYX_ERR(0, 486, __pyx_L3_error)
11862 CYTHON_FALLTHROUGH;
11864 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
11866 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 18); __PYX_ERR(0, 486, __pyx_L3_error)
11868 CYTHON_FALLTHROUGH;
11870 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
11872 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 19); __PYX_ERR(0, 486, __pyx_L3_error)
11874 CYTHON_FALLTHROUGH;
11876 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementResidual)) != 0)) kw_args--;
11878 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 20); __PYX_ERR(0, 486, __pyx_L3_error)
11881 if (unlikely(kw_args > 0)) {
11882 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementResidual") < 0)) __PYX_ERR(0, 486, __pyx_L3_error)
11884 }
else if (PyTuple_GET_SIZE(__pyx_args) != 21) {
11885 goto __pyx_L5_argtuple_error;
11887 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11888 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11889 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11890 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11891 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11892 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11893 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11894 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11895 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11896 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11897 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11898 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11899 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11900 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11901 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11902 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11903 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11904 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11905 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11906 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11907 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11909 __pyx_v_gravity = ((PyArrayObject *)values[0]);
11910 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
11911 __pyx_v_colind = ((PyArrayObject *)values[2]);
11912 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error)
11913 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L3_error)
11914 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error)
11915 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
11916 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
11917 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L3_error)
11918 __pyx_v_q_u = ((PyArrayObject *)values[9]);
11919 __pyx_v_q_grad_u = ((PyArrayObject *)values[10]);
11920 __pyx_v_q_grad_w = ((PyArrayObject *)values[11]);
11921 __pyx_v_q_detJ = ((PyArrayObject *)values[12]);
11922 __pyx_v_q_m = ((PyArrayObject *)values[13]);
11923 __pyx_v_q_mt = ((PyArrayObject *)values[14]);
11924 __pyx_v_q_r = ((PyArrayObject *)values[15]);
11925 __pyx_v_q_kr = ((PyArrayObject *)values[16]);
11926 __pyx_v_q_kr_up = ((PyArrayObject *)values[17]);
11927 __pyx_v_q_flin = ((PyArrayObject *)values[18]);
11928 __pyx_v_q_alin = ((PyArrayObject *)values[19]);
11929 __pyx_v_elementResidual = ((PyArrayObject *)values[20]);
11931 goto __pyx_L4_argument_unpacking_done;
11932 __pyx_L5_argtuple_error:;
11933 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 486, __pyx_L3_error)
11935 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
11936 __Pyx_RefNannyFinishContext();
11938 __pyx_L4_argument_unpacking_done:;
11939 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 486, __pyx_L1_error)
11940 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 487, __pyx_L1_error)
11941 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 488, __pyx_L1_error)
11942 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 493, __pyx_L1_error)
11943 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 494, __pyx_L1_error)
11944 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 497, __pyx_L1_error)
11945 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 498, __pyx_L1_error)
11946 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 499, __pyx_L1_error)
11947 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 501, __pyx_L1_error)
11948 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 502, __pyx_L1_error)
11949 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 503, __pyx_L1_error)
11950 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 504, __pyx_L1_error)
11951 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 505, __pyx_L1_error)
11952 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 506, __pyx_L1_error)
11953 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 509, __pyx_L1_error)
11954 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 510, __pyx_L1_error)
11955 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementResidual), __pyx_ptype_5numpy_ndarray, 1,
"elementResidual", 0))) __PYX_ERR(0, 512, __pyx_L1_error)
11956 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_mt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementResidual);
11963 __Pyx_RefNannyFinishContext();
11967 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual) {
11968 CYTHON_UNUSED
int __pyx_v_upwindFlag;
11969 PyObject *__pyx_v_q = NULL;
11976 PyArrayObject *__pyx_v_a_up = 0;
11977 PyArrayObject *__pyx_v_f_up = 0;
11978 double __pyx_v_nAvgWeight;
11979 double __pyx_v_weight;
11980 double __pyx_v_volFactor;
11981 double __pyx_v_volume;
11982 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
11983 __Pyx_Buffer __pyx_pybuffer_a_up;
11984 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
11985 __Pyx_Buffer __pyx_pybuffer_colind;
11986 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
11987 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
11988 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
11989 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
11990 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementResidual;
11991 __Pyx_Buffer __pyx_pybuffer_elementResidual;
11992 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
11993 __Pyx_Buffer __pyx_pybuffer_f_up;
11994 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
11995 __Pyx_Buffer __pyx_pybuffer_gravity;
11996 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
11997 __Pyx_Buffer __pyx_pybuffer_q_alin;
11998 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
11999 __Pyx_Buffer __pyx_pybuffer_q_detJ;
12000 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
12001 __Pyx_Buffer __pyx_pybuffer_q_flin;
12002 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
12003 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
12004 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
12005 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
12006 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
12007 __Pyx_Buffer __pyx_pybuffer_q_kr;
12008 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
12009 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
12010 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
12011 __Pyx_Buffer __pyx_pybuffer_q_m;
12012 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
12013 __Pyx_Buffer __pyx_pybuffer_q_mt;
12014 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
12015 __Pyx_Buffer __pyx_pybuffer_q_r;
12016 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
12017 __Pyx_Buffer __pyx_pybuffer_q_u;
12018 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
12019 __Pyx_Buffer __pyx_pybuffer_rowptr;
12020 PyObject *__pyx_r = NULL;
12021 __Pyx_RefNannyDeclarations
12022 PyObject *__pyx_t_1 = NULL;
12023 PyObject *__pyx_t_2 = NULL;
12024 Py_ssize_t __pyx_t_3;
12025 PyObject *__pyx_t_4 = NULL;
12026 PyObject *__pyx_t_5 = NULL;
12028 Py_ssize_t __pyx_t_7;
12030 PyObject *__pyx_t_9 = NULL;
12031 PyArrayObject *__pyx_t_10 = NULL;
12032 PyArrayObject *__pyx_t_11 = NULL;
12036 Py_ssize_t __pyx_t_15;
12041 Py_ssize_t __pyx_t_20;
12042 Py_ssize_t __pyx_t_21;
12049 Py_ssize_t __pyx_t_28;
12050 Py_ssize_t __pyx_t_29;
12051 Py_ssize_t __pyx_t_30;
12052 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_31;
12053 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_32;
12055 Py_ssize_t __pyx_t_34;
12056 Py_ssize_t __pyx_t_35;
12057 Py_ssize_t __pyx_t_36;
12058 Py_ssize_t __pyx_t_37;
12059 Py_ssize_t __pyx_t_38;
12060 int __pyx_lineno = 0;
12061 const char *__pyx_filename = NULL;
12062 int __pyx_clineno = 0;
12063 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual", 0);
12064 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
12065 __pyx_pybuffer_a_up.refcount = 0;
12066 __pyx_pybuffernd_a_up.data = NULL;
12067 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
12068 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
12069 __pyx_pybuffer_f_up.refcount = 0;
12070 __pyx_pybuffernd_f_up.data = NULL;
12071 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
12072 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
12073 __pyx_pybuffer_gravity.refcount = 0;
12074 __pyx_pybuffernd_gravity.data = NULL;
12075 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
12076 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
12077 __pyx_pybuffer_rowptr.refcount = 0;
12078 __pyx_pybuffernd_rowptr.data = NULL;
12079 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
12080 __pyx_pybuffer_colind.pybuffer.buf = NULL;
12081 __pyx_pybuffer_colind.refcount = 0;
12082 __pyx_pybuffernd_colind.data = NULL;
12083 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
12084 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
12085 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
12086 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
12087 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
12088 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
12089 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
12090 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
12091 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
12092 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
12093 __pyx_pybuffer_q_u.refcount = 0;
12094 __pyx_pybuffernd_q_u.data = NULL;
12095 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
12096 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
12097 __pyx_pybuffer_q_grad_u.refcount = 0;
12098 __pyx_pybuffernd_q_grad_u.data = NULL;
12099 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
12100 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
12101 __pyx_pybuffer_q_grad_w.refcount = 0;
12102 __pyx_pybuffernd_q_grad_w.data = NULL;
12103 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
12104 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
12105 __pyx_pybuffer_q_detJ.refcount = 0;
12106 __pyx_pybuffernd_q_detJ.data = NULL;
12107 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
12108 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
12109 __pyx_pybuffer_q_m.refcount = 0;
12110 __pyx_pybuffernd_q_m.data = NULL;
12111 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
12112 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
12113 __pyx_pybuffer_q_mt.refcount = 0;
12114 __pyx_pybuffernd_q_mt.data = NULL;
12115 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
12116 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
12117 __pyx_pybuffer_q_r.refcount = 0;
12118 __pyx_pybuffernd_q_r.data = NULL;
12119 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
12120 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
12121 __pyx_pybuffer_q_kr.refcount = 0;
12122 __pyx_pybuffernd_q_kr.data = NULL;
12123 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
12124 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
12125 __pyx_pybuffer_q_kr_up.refcount = 0;
12126 __pyx_pybuffernd_q_kr_up.data = NULL;
12127 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
12128 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
12129 __pyx_pybuffer_q_flin.refcount = 0;
12130 __pyx_pybuffernd_q_flin.data = NULL;
12131 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
12132 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
12133 __pyx_pybuffer_q_alin.refcount = 0;
12134 __pyx_pybuffernd_q_alin.data = NULL;
12135 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
12136 __pyx_pybuffer_elementResidual.pybuffer.buf = NULL;
12137 __pyx_pybuffer_elementResidual.refcount = 0;
12138 __pyx_pybuffernd_elementResidual.data = NULL;
12139 __pyx_pybuffernd_elementResidual.rcbuffer = &__pyx_pybuffer_elementResidual;
12141 __Pyx_BufFmt_StackElem __pyx_stack[1];
12142 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12144 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
12146 __Pyx_BufFmt_StackElem __pyx_stack[1];
12147 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12149 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
12151 __Pyx_BufFmt_StackElem __pyx_stack[1];
12152 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12154 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
12156 __Pyx_BufFmt_StackElem __pyx_stack[1];
12157 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12159 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
12161 __Pyx_BufFmt_StackElem __pyx_stack[1];
12162 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12164 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
12166 __Pyx_BufFmt_StackElem __pyx_stack[1];
12167 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12169 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
12171 __Pyx_BufFmt_StackElem __pyx_stack[1];
12172 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12174 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
12176 __Pyx_BufFmt_StackElem __pyx_stack[1];
12177 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12179 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
12181 __Pyx_BufFmt_StackElem __pyx_stack[1];
12182 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12184 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
12186 __Pyx_BufFmt_StackElem __pyx_stack[1];
12187 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12189 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
12191 __Pyx_BufFmt_StackElem __pyx_stack[1];
12192 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12194 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
12196 __Pyx_BufFmt_StackElem __pyx_stack[1];
12197 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12199 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
12201 __Pyx_BufFmt_StackElem __pyx_stack[1];
12202 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12204 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
12206 __Pyx_BufFmt_StackElem __pyx_stack[1];
12207 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12209 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
12211 __Pyx_BufFmt_StackElem __pyx_stack[1];
12212 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12214 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
12216 __Pyx_BufFmt_StackElem __pyx_stack[1];
12217 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12219 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
12221 __Pyx_BufFmt_StackElem __pyx_stack[1];
12222 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementResidual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12224 __pyx_pybuffernd_elementResidual.diminfo[0].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementResidual.diminfo[0].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementResidual.diminfo[1].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementResidual.diminfo[1].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[1];
12233 __pyx_v_upwindFlag = 1;
12242 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
12243 __Pyx_GOTREF(__pyx_t_1);
12244 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
12245 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
12246 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
12247 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
12248 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
12249 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
12250 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
12251 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
12252 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
12253 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
12254 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
12255 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
12256 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
12257 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
12258 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
12259 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
12260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12262 if (__pyx_t_3 >= 5)
break;
12263 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12264 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 529, __pyx_L1_error)
12266 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
12267 __Pyx_GOTREF(__pyx_t_1);
12269 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
12279 #ifndef CYTHON_WITHOUT_ASSERTIONS
12280 if (unlikely(!Py_OptimizeFlag)) {
12281 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
12282 __Pyx_GOTREF(__pyx_t_1);
12283 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
12284 __Pyx_GOTREF(__pyx_t_4);
12285 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12286 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
12287 __Pyx_GOTREF(__pyx_t_1);
12288 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error)
12289 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12290 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12291 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 530, __pyx_L1_error)
12292 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12293 if (unlikely(!__pyx_t_6)) {
12294 PyErr_SetNone(PyExc_AssertionError);
12295 __PYX_ERR(0, 530, __pyx_L1_error)
12308 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12317 #ifndef CYTHON_WITHOUT_ASSERTIONS
12318 if (unlikely(!Py_OptimizeFlag)) {
12319 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
12320 PyErr_SetNone(PyExc_AssertionError);
12321 __PYX_ERR(0, 531, __pyx_L1_error)
12333 __pyx_t_7 = __pyx_v_nSpace;
12335 if (__pyx_t_7 < 0) {
12336 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12337 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
12338 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
12339 if (unlikely(__pyx_t_8 != -1)) {
12340 __Pyx_RaiseBufferIndexError(__pyx_t_8);
12341 __PYX_ERR(0, 532, __pyx_L1_error)
12343 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
12352 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
12353 __Pyx_GOTREF(__pyx_t_5);
12354 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
12355 __Pyx_GOTREF(__pyx_t_1);
12356 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12357 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
12358 __Pyx_GOTREF(__pyx_t_5);
12361 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
12362 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
12363 if (likely(__pyx_t_4)) {
12364 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
12365 __Pyx_INCREF(__pyx_t_4);
12366 __Pyx_INCREF(
function);
12367 __Pyx_DECREF_SET(__pyx_t_1,
function);
12371 #if CYTHON_FAST_PYCALL
12372 if (PyFunction_Check(__pyx_t_1)) {
12373 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
12374 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12375 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12376 __Pyx_GOTREF(__pyx_t_2);
12377 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12380 #if CYTHON_FAST_PYCCALL
12381 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
12382 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
12383 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12384 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12385 __Pyx_GOTREF(__pyx_t_2);
12386 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12390 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 536, __pyx_L1_error)
12391 __Pyx_GOTREF(__pyx_t_9);
12393 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
12395 __Pyx_GIVEREF(__pyx_t_5);
12396 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
12397 __Pyx_INCREF(__pyx_n_s_d);
12398 __Pyx_GIVEREF(__pyx_n_s_d);
12399 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
12401 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12402 __Pyx_GOTREF(__pyx_t_2);
12403 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12405 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12406 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 536, __pyx_L1_error)
12407 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
12409 __Pyx_BufFmt_StackElem __pyx_stack[1];
12410 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12411 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
12412 __PYX_ERR(0, 536, __pyx_L1_error)
12413 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
12417 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
12427 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
12428 __Pyx_GOTREF(__pyx_t_1);
12429 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 537, __pyx_L1_error)
12430 __Pyx_GOTREF(__pyx_t_9);
12431 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12432 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
12433 __Pyx_GOTREF(__pyx_t_1);
12436 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
12437 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
12438 if (likely(__pyx_t_5)) {
12439 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
12440 __Pyx_INCREF(__pyx_t_5);
12441 __Pyx_INCREF(
function);
12442 __Pyx_DECREF_SET(__pyx_t_9,
function);
12446 #if CYTHON_FAST_PYCALL
12447 if (PyFunction_Check(__pyx_t_9)) {
12448 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12449 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12450 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12451 __Pyx_GOTREF(__pyx_t_2);
12452 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12455 #if CYTHON_FAST_PYCCALL
12456 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
12457 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12458 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12459 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12460 __Pyx_GOTREF(__pyx_t_2);
12461 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12465 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
12466 __Pyx_GOTREF(__pyx_t_4);
12468 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
12470 __Pyx_GIVEREF(__pyx_t_1);
12471 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
12472 __Pyx_INCREF(__pyx_n_s_d);
12473 __Pyx_GIVEREF(__pyx_n_s_d);
12474 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
12476 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12477 __Pyx_GOTREF(__pyx_t_2);
12478 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12480 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12481 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 537, __pyx_L1_error)
12482 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
12484 __Pyx_BufFmt_StackElem __pyx_stack[1];
12485 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12486 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
12487 __PYX_ERR(0, 537, __pyx_L1_error)
12488 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
12492 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
12502 __pyx_t_12 = (__pyx_v_nSpace + 1.);
12503 if (unlikely(__pyx_t_12 == 0)) {
12504 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
12505 __PYX_ERR(0, 539, __pyx_L1_error)
12507 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
12516 __pyx_v_weight = 1.0;
12517 __pyx_v_volFactor = 1.0;
12526 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
12536 __pyx_v_volFactor = 0.5;
12554 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
12564 __pyx_v_volFactor = (1.0 / 6.0);
12582 __pyx_t_8 = __pyx_v_nElements_global;
12583 __pyx_t_13 = __pyx_t_8;
12584 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
12585 __pyx_v_eN = __pyx_t_14;
12594 __pyx_t_7 = __pyx_v_eN;
12597 if (__pyx_t_7 < 0) {
12598 __pyx_t_7 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
12599 if (unlikely(__pyx_t_7 < 0)) __pyx_t_16 = 0;
12600 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_16 = 0;
12601 if (__pyx_t_15 < 0) {
12602 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
12603 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
12604 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_16 = 1;
12605 if (unlikely(__pyx_t_16 != -1)) {
12606 __Pyx_RaiseBufferIndexError(__pyx_t_16);
12607 __PYX_ERR(0, 547, __pyx_L1_error)
12609 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
12618 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
12627 __pyx_t_16 = __pyx_v_nDOF_test_element;
12628 __pyx_t_17 = __pyx_t_16;
12629 for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
12630 __pyx_v_i = __pyx_t_18;
12639 __pyx_t_15 = __pyx_v_eN;
12640 __pyx_t_7 = __pyx_v_i;
12642 if (__pyx_t_15 < 0) {
12643 __pyx_t_15 += __pyx_pybuffernd_q_mt.diminfo[0].shape;
12644 if (unlikely(__pyx_t_15 < 0)) __pyx_t_19 = 0;
12645 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_mt.diminfo[0].shape)) __pyx_t_19 = 0;
12646 if (__pyx_t_7 < 0) {
12647 __pyx_t_7 += __pyx_pybuffernd_q_mt.diminfo[1].shape;
12648 if (unlikely(__pyx_t_7 < 0)) __pyx_t_19 = 1;
12649 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_mt.diminfo[1].shape)) __pyx_t_19 = 1;
12650 if (unlikely(__pyx_t_19 != -1)) {
12651 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12652 __PYX_ERR(0, 553, __pyx_L1_error)
12654 __pyx_t_20 = __pyx_v_eN;
12655 __pyx_t_21 = __pyx_v_i;
12657 if (__pyx_t_20 < 0) {
12658 __pyx_t_20 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12659 if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 0;
12660 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_19 = 0;
12661 if (__pyx_t_21 < 0) {
12662 __pyx_t_21 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12663 if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 1;
12664 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_19 = 1;
12665 if (unlikely(__pyx_t_19 != -1)) {
12666 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12667 __PYX_ERR(0, 553, __pyx_L1_error)
12669 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_mt.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_mt.diminfo[1].strides)));
12678 __pyx_t_7 = __pyx_v_eN;
12679 __pyx_t_15 = __pyx_v_i;
12681 if (__pyx_t_7 < 0) {
12682 __pyx_t_7 += __pyx_pybuffernd_q_r.diminfo[0].shape;
12683 if (unlikely(__pyx_t_7 < 0)) __pyx_t_19 = 0;
12684 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_r.diminfo[0].shape)) __pyx_t_19 = 0;
12685 if (__pyx_t_15 < 0) {
12686 __pyx_t_15 += __pyx_pybuffernd_q_r.diminfo[1].shape;
12687 if (unlikely(__pyx_t_15 < 0)) __pyx_t_19 = 1;
12688 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_r.diminfo[1].shape)) __pyx_t_19 = 1;
12689 if (unlikely(__pyx_t_19 != -1)) {
12690 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12691 __PYX_ERR(0, 555, __pyx_L1_error)
12693 __pyx_t_21 = __pyx_v_eN;
12694 __pyx_t_20 = __pyx_v_i;
12696 if (__pyx_t_21 < 0) {
12697 __pyx_t_21 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12698 if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 0;
12699 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_19 = 0;
12700 if (__pyx_t_20 < 0) {
12701 __pyx_t_20 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12702 if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 1;
12703 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_19 = 1;
12704 if (unlikely(__pyx_t_19 != -1)) {
12705 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12706 __PYX_ERR(0, 555, __pyx_L1_error)
12708 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_r.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_r.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_r.diminfo[1].strides)));
12717 __pyx_t_19 = __pyx_v_nElementBoundaries_element;
12718 __pyx_t_22 = __pyx_t_19;
12719 for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
12720 __pyx_v_ebN = __pyx_t_23;
12729 __pyx_t_24 = __pyx_v_nnz;
12730 __pyx_t_25 = __pyx_t_24;
12731 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
12732 __pyx_v_ii = __pyx_t_26;
12741 __pyx_t_15 = __pyx_v_eN;
12742 __pyx_t_7 = __pyx_v_ebN;
12743 __pyx_t_20 = __pyx_v_ii;
12745 if (__pyx_t_15 < 0) {
12746 __pyx_t_15 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
12747 if (unlikely(__pyx_t_15 < 0)) __pyx_t_27 = 0;
12748 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_27 = 0;
12749 if (__pyx_t_7 < 0) {
12750 __pyx_t_7 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
12751 if (unlikely(__pyx_t_7 < 0)) __pyx_t_27 = 1;
12752 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_27 = 1;
12753 if (__pyx_t_20 < 0) {
12754 __pyx_t_20 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
12755 if (unlikely(__pyx_t_20 < 0)) __pyx_t_27 = 2;
12756 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_27 = 2;
12757 if (unlikely(__pyx_t_27 != -1)) {
12758 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12759 __PYX_ERR(0, 561, __pyx_L1_error)
12761 __pyx_t_21 = __pyx_v_eN;
12762 __pyx_t_28 = __pyx_v_ebN;
12764 if (__pyx_t_21 < 0) {
12765 __pyx_t_21 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12766 if (unlikely(__pyx_t_21 < 0)) __pyx_t_27 = 0;
12767 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_27 = 0;
12768 if (__pyx_t_28 < 0) {
12769 __pyx_t_28 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12770 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 1;
12771 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_27 = 1;
12772 if (unlikely(__pyx_t_27 != -1)) {
12773 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12774 __PYX_ERR(0, 561, __pyx_L1_error)
12776 __pyx_t_29 = __pyx_v_ii;
12778 if (__pyx_t_29 < 0) {
12779 __pyx_t_29 += __pyx_pybuffernd_a_up.diminfo[0].shape;
12780 if (unlikely(__pyx_t_29 < 0)) __pyx_t_27 = 0;
12781 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_27 = 0;
12782 if (unlikely(__pyx_t_27 != -1)) {
12783 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12784 __PYX_ERR(0, 561, __pyx_L1_error)
12786 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12796 __pyx_t_24 = __pyx_v_nSpace;
12797 __pyx_t_25 = __pyx_t_24;
12798 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
12799 __pyx_v_I = __pyx_t_26;
12808 __pyx_t_28 = __pyx_v_eN;
12809 __pyx_t_21 = __pyx_v_ebN;
12810 __pyx_t_20 = __pyx_v_I;
12812 if (__pyx_t_28 < 0) {
12813 __pyx_t_28 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
12814 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 0;
12815 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_27 = 0;
12816 if (__pyx_t_21 < 0) {
12817 __pyx_t_21 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
12818 if (unlikely(__pyx_t_21 < 0)) __pyx_t_27 = 1;
12819 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_27 = 1;
12820 if (__pyx_t_20 < 0) {
12821 __pyx_t_20 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
12822 if (unlikely(__pyx_t_20 < 0)) __pyx_t_27 = 2;
12823 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_27 = 2;
12824 if (unlikely(__pyx_t_27 != -1)) {
12825 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12826 __PYX_ERR(0, 563, __pyx_L1_error)
12828 __pyx_t_7 = __pyx_v_eN;
12829 __pyx_t_15 = __pyx_v_ebN;
12831 if (__pyx_t_7 < 0) {
12832 __pyx_t_7 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12833 if (unlikely(__pyx_t_7 < 0)) __pyx_t_27 = 0;
12834 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_27 = 0;
12835 if (__pyx_t_15 < 0) {
12836 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12837 if (unlikely(__pyx_t_15 < 0)) __pyx_t_27 = 1;
12838 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_27 = 1;
12839 if (unlikely(__pyx_t_27 != -1)) {
12840 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12841 __PYX_ERR(0, 563, __pyx_L1_error)
12843 __pyx_t_29 = __pyx_v_I;
12845 if (__pyx_t_29 < 0) {
12846 __pyx_t_29 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12847 if (unlikely(__pyx_t_29 < 0)) __pyx_t_27 = 0;
12848 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_27 = 0;
12849 if (unlikely(__pyx_t_27 != -1)) {
12850 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12851 __PYX_ERR(0, 563, __pyx_L1_error)
12853 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12863 __pyx_t_24 = __pyx_v_nSpace;
12864 __pyx_t_25 = __pyx_t_24;
12865 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
12866 __pyx_v_I = __pyx_t_26;
12875 __pyx_t_15 = __pyx_v_I;
12877 if (__pyx_t_15 < 0) {
12878 __pyx_t_15 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12879 if (unlikely(__pyx_t_15 < 0)) __pyx_t_27 = 0;
12880 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_27 = 0;
12881 if (unlikely(__pyx_t_27 != -1)) {
12882 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12883 __PYX_ERR(0, 567, __pyx_L1_error)
12885 __pyx_t_7 = __pyx_v_eN;
12886 __pyx_t_20 = __pyx_v_ebN;
12887 __pyx_t_21 = __pyx_v_i;
12888 __pyx_t_28 = __pyx_v_I;
12890 if (__pyx_t_7 < 0) {
12891 __pyx_t_7 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
12892 if (unlikely(__pyx_t_7 < 0)) __pyx_t_27 = 0;
12893 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_27 = 0;
12894 if (__pyx_t_20 < 0) {
12895 __pyx_t_20 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
12896 if (unlikely(__pyx_t_20 < 0)) __pyx_t_27 = 1;
12897 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_27 = 1;
12898 if (__pyx_t_21 < 0) {
12899 __pyx_t_21 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
12900 if (unlikely(__pyx_t_21 < 0)) __pyx_t_27 = 2;
12901 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_27 = 2;
12902 if (__pyx_t_28 < 0) {
12903 __pyx_t_28 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
12904 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 3;
12905 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_27 = 3;
12906 if (unlikely(__pyx_t_27 != -1)) {
12907 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12908 __PYX_ERR(0, 567, __pyx_L1_error)
12910 __pyx_t_29 = __pyx_v_eN;
12911 __pyx_t_30 = __pyx_v_i;
12913 if (__pyx_t_29 < 0) {
12914 __pyx_t_29 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12915 if (unlikely(__pyx_t_29 < 0)) __pyx_t_27 = 0;
12916 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_27 = 0;
12917 if (__pyx_t_30 < 0) {
12918 __pyx_t_30 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12919 if (unlikely(__pyx_t_30 < 0)) __pyx_t_27 = 1;
12920 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_27 = 1;
12921 if (unlikely(__pyx_t_27 != -1)) {
12922 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12923 __PYX_ERR(0, 567, __pyx_L1_error)
12925 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_elementResidual.diminfo[1].strides) -= ((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_f_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_28, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
12934 __pyx_t_28 = (__pyx_v_I + 1);
12936 if (__pyx_t_28 < 0) {
12937 __pyx_t_28 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12938 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 0;
12939 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_27 = 0;
12940 if (unlikely(__pyx_t_27 != -1)) {
12941 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12942 __PYX_ERR(0, 568, __pyx_L1_error)
12944 __pyx_t_31 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rowptr.diminfo[0].strides));
12945 __pyx_t_28 = __pyx_v_I;
12947 if (__pyx_t_28 < 0) {
12948 __pyx_t_28 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12949 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 0;
12950 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_27 = 0;
12951 if (unlikely(__pyx_t_27 != -1)) {
12952 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12953 __PYX_ERR(0, 568, __pyx_L1_error)
12955 __pyx_t_32 = __pyx_t_31;
12956 for (__pyx_t_27 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_27 < __pyx_t_32; __pyx_t_27+=1) {
12957 __pyx_v_ii = __pyx_t_27;
12966 __pyx_t_21 = __pyx_v_ii;
12968 if (__pyx_t_21 < 0) {
12969 __pyx_t_21 += __pyx_pybuffernd_a_up.diminfo[0].shape;
12970 if (unlikely(__pyx_t_21 < 0)) __pyx_t_33 = 0;
12971 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_33 = 0;
12972 if (unlikely(__pyx_t_33 != -1)) {
12973 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12974 __PYX_ERR(0, 569, __pyx_L1_error)
12976 __pyx_t_20 = __pyx_v_ii;
12978 if (__pyx_t_20 < 0) {
12979 __pyx_t_20 += __pyx_pybuffernd_colind.diminfo[0].shape;
12980 if (unlikely(__pyx_t_20 < 0)) __pyx_t_33 = 0;
12981 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_33 = 0;
12982 if (unlikely(__pyx_t_33 != -1)) {
12983 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12984 __PYX_ERR(0, 569, __pyx_L1_error)
12986 __pyx_t_7 = __pyx_v_eN;
12987 __pyx_t_15 = __pyx_v_ebN;
12988 __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_colind.diminfo[0].strides));
12990 if (__pyx_t_7 < 0) {
12991 __pyx_t_7 += __pyx_pybuffernd_q_grad_u.diminfo[0].shape;
12992 if (unlikely(__pyx_t_7 < 0)) __pyx_t_33 = 0;
12993 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_grad_u.diminfo[0].shape)) __pyx_t_33 = 0;
12994 if (__pyx_t_15 < 0) {
12995 __pyx_t_15 += __pyx_pybuffernd_q_grad_u.diminfo[1].shape;
12996 if (unlikely(__pyx_t_15 < 0)) __pyx_t_33 = 1;
12997 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_grad_u.diminfo[1].shape)) __pyx_t_33 = 1;
12998 if (__pyx_t_30 < 0) {
12999 __pyx_t_30 += __pyx_pybuffernd_q_grad_u.diminfo[2].shape;
13000 if (unlikely(__pyx_t_30 < 0)) __pyx_t_33 = 2;
13001 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_q_grad_u.diminfo[2].shape)) __pyx_t_33 = 2;
13002 if (unlikely(__pyx_t_33 != -1)) {
13003 __Pyx_RaiseBufferIndexError(__pyx_t_33);
13004 __PYX_ERR(0, 569, __pyx_L1_error)
13006 __pyx_t_29 = __pyx_v_eN;
13007 __pyx_t_34 = __pyx_v_ebN;
13008 __pyx_t_35 = __pyx_v_i;
13009 __pyx_t_36 = __pyx_v_I;
13011 if (__pyx_t_29 < 0) {
13012 __pyx_t_29 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
13013 if (unlikely(__pyx_t_29 < 0)) __pyx_t_33 = 0;
13014 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_33 = 0;
13015 if (__pyx_t_34 < 0) {
13016 __pyx_t_34 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
13017 if (unlikely(__pyx_t_34 < 0)) __pyx_t_33 = 1;
13018 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_33 = 1;
13019 if (__pyx_t_35 < 0) {
13020 __pyx_t_35 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
13021 if (unlikely(__pyx_t_35 < 0)) __pyx_t_33 = 2;
13022 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_33 = 2;
13023 if (__pyx_t_36 < 0) {
13024 __pyx_t_36 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
13025 if (unlikely(__pyx_t_36 < 0)) __pyx_t_33 = 3;
13026 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_33 = 3;
13027 if (unlikely(__pyx_t_33 != -1)) {
13028 __Pyx_RaiseBufferIndexError(__pyx_t_33);
13029 __PYX_ERR(0, 569, __pyx_L1_error)
13031 __pyx_t_37 = __pyx_v_eN;
13032 __pyx_t_38 = __pyx_v_i;
13034 if (__pyx_t_37 < 0) {
13035 __pyx_t_37 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
13036 if (unlikely(__pyx_t_37 < 0)) __pyx_t_33 = 0;
13037 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_33 = 0;
13038 if (__pyx_t_38 < 0) {
13039 __pyx_t_38 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
13040 if (unlikely(__pyx_t_38 < 0)) __pyx_t_33 = 1;
13041 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_33 = 1;
13042 if (unlikely(__pyx_t_33 != -1)) {
13043 __Pyx_RaiseBufferIndexError(__pyx_t_33);
13044 __PYX_ERR(0, 569, __pyx_L1_error)
13046 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_grad_u.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_grad_u.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_q_grad_u.diminfo[2].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_36, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
13062 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13065 __Pyx_XDECREF(__pyx_t_1);
13066 __Pyx_XDECREF(__pyx_t_2);
13067 __Pyx_XDECREF(__pyx_t_4);
13068 __Pyx_XDECREF(__pyx_t_5);
13069 __Pyx_XDECREF(__pyx_t_9);
13070 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13071 __Pyx_PyThreadState_declare
13072 __Pyx_PyThreadState_assign
13073 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13074 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13075 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13076 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13077 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13078 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
13079 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13080 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13081 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13082 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13083 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13084 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13085 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13086 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13087 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13088 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13089 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13090 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13091 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13092 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13093 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13094 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
13098 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13099 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13100 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13101 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13102 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
13103 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13104 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13105 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13106 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13107 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13108 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13109 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13110 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13111 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13112 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13113 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13114 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13115 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13116 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13118 __Pyx_XDECREF(__pyx_v_q);
13119 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
13120 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
13121 __Pyx_XGIVEREF(__pyx_r);
13122 __Pyx_RefNannyFinishContext();
13135 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13136 static char __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
13137 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian = {
"RE_NCP1_getElementJacobian", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian};
13138 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13139 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
13140 PyArrayObject *__pyx_v_rowptr = 0;
13141 PyArrayObject *__pyx_v_colind = 0;
13142 int __pyx_v_nSpace;
13143 int __pyx_v_nElements_global;
13144 int __pyx_v_nElementBoundaries_element;
13145 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
13146 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
13147 int __pyx_v_nDOF_test_element;
13148 int __pyx_v_nDOF_trial_element;
13149 PyArrayObject *__pyx_v_q_u = 0;
13150 CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u = 0;
13151 PyArrayObject *__pyx_v_q_grad_w = 0;
13152 PyArrayObject *__pyx_v_q_grad_v = 0;
13153 PyArrayObject *__pyx_v_q_detJ = 0;
13154 PyArrayObject *__pyx_v_q_m = 0;
13155 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm = 0;
13156 PyArrayObject *__pyx_v_q_mt = 0;
13157 PyArrayObject *__pyx_v_q_dmt = 0;
13158 PyArrayObject *__pyx_v_q_r = 0;
13159 PyArrayObject *__pyx_v_q_kr = 0;
13160 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr = 0;
13161 PyArrayObject *__pyx_v_q_kr_up = 0;
13162 PyArrayObject *__pyx_v_q_flin = 0;
13163 PyArrayObject *__pyx_v_q_alin = 0;
13164 PyArrayObject *__pyx_v_elementJacobian = 0;
13165 int __pyx_lineno = 0;
13166 const char *__pyx_filename = NULL;
13167 int __pyx_clineno = 0;
13168 PyObject *__pyx_r = 0;
13169 __Pyx_RefNannyDeclarations
13170 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian (wrapper)", 0);
13172 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_grad_v,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_dm,&__pyx_n_s_q_mt,&__pyx_n_s_q_dmt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementJacobian,0};
13173 PyObject* values[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
13174 if (unlikely(__pyx_kwds)) {
13175 Py_ssize_t kw_args;
13176 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13177 switch (pos_args) {
13178 case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
13179 CYTHON_FALLTHROUGH;
13180 case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
13181 CYTHON_FALLTHROUGH;
13182 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
13183 CYTHON_FALLTHROUGH;
13184 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
13185 CYTHON_FALLTHROUGH;
13186 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
13187 CYTHON_FALLTHROUGH;
13188 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
13189 CYTHON_FALLTHROUGH;
13190 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
13191 CYTHON_FALLTHROUGH;
13192 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
13193 CYTHON_FALLTHROUGH;
13194 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
13195 CYTHON_FALLTHROUGH;
13196 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
13197 CYTHON_FALLTHROUGH;
13198 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
13199 CYTHON_FALLTHROUGH;
13200 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
13201 CYTHON_FALLTHROUGH;
13202 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
13203 CYTHON_FALLTHROUGH;
13204 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
13205 CYTHON_FALLTHROUGH;
13206 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
13207 CYTHON_FALLTHROUGH;
13208 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
13209 CYTHON_FALLTHROUGH;
13210 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
13211 CYTHON_FALLTHROUGH;
13212 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
13213 CYTHON_FALLTHROUGH;
13214 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
13215 CYTHON_FALLTHROUGH;
13216 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13217 CYTHON_FALLTHROUGH;
13218 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13219 CYTHON_FALLTHROUGH;
13220 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13221 CYTHON_FALLTHROUGH;
13222 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13223 CYTHON_FALLTHROUGH;
13224 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13225 CYTHON_FALLTHROUGH;
13226 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13227 CYTHON_FALLTHROUGH;
13228 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13229 CYTHON_FALLTHROUGH;
13231 default:
goto __pyx_L5_argtuple_error;
13233 kw_args = PyDict_Size(__pyx_kwds);
13234 switch (pos_args) {
13236 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
13237 else goto __pyx_L5_argtuple_error;
13238 CYTHON_FALLTHROUGH;
13240 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
13242 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 1); __PYX_ERR(0, 574, __pyx_L3_error)
13244 CYTHON_FALLTHROUGH;
13246 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
13248 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 2); __PYX_ERR(0, 574, __pyx_L3_error)
13250 CYTHON_FALLTHROUGH;
13252 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
13254 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 3); __PYX_ERR(0, 574, __pyx_L3_error)
13256 CYTHON_FALLTHROUGH;
13258 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
13260 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 4); __PYX_ERR(0, 574, __pyx_L3_error)
13262 CYTHON_FALLTHROUGH;
13264 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
13266 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 5); __PYX_ERR(0, 574, __pyx_L3_error)
13268 CYTHON_FALLTHROUGH;
13270 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
13272 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 6); __PYX_ERR(0, 574, __pyx_L3_error)
13274 CYTHON_FALLTHROUGH;
13276 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
13278 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 7); __PYX_ERR(0, 574, __pyx_L3_error)
13280 CYTHON_FALLTHROUGH;
13282 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
13284 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 8); __PYX_ERR(0, 574, __pyx_L3_error)
13286 CYTHON_FALLTHROUGH;
13288 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
13290 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 9); __PYX_ERR(0, 574, __pyx_L3_error)
13292 CYTHON_FALLTHROUGH;
13294 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
13296 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 10); __PYX_ERR(0, 574, __pyx_L3_error)
13298 CYTHON_FALLTHROUGH;
13300 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
13302 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 11); __PYX_ERR(0, 574, __pyx_L3_error)
13304 CYTHON_FALLTHROUGH;
13306 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
13308 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 12); __PYX_ERR(0, 574, __pyx_L3_error)
13310 CYTHON_FALLTHROUGH;
13312 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_v)) != 0)) kw_args--;
13314 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 13); __PYX_ERR(0, 574, __pyx_L3_error)
13316 CYTHON_FALLTHROUGH;
13318 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
13320 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 14); __PYX_ERR(0, 574, __pyx_L3_error)
13322 CYTHON_FALLTHROUGH;
13324 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
13326 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 15); __PYX_ERR(0, 574, __pyx_L3_error)
13328 CYTHON_FALLTHROUGH;
13330 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dm)) != 0)) kw_args--;
13332 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 16); __PYX_ERR(0, 574, __pyx_L3_error)
13334 CYTHON_FALLTHROUGH;
13336 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
13338 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 17); __PYX_ERR(0, 574, __pyx_L3_error)
13340 CYTHON_FALLTHROUGH;
13342 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dmt)) != 0)) kw_args--;
13344 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 18); __PYX_ERR(0, 574, __pyx_L3_error)
13346 CYTHON_FALLTHROUGH;
13348 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
13350 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 19); __PYX_ERR(0, 574, __pyx_L3_error)
13352 CYTHON_FALLTHROUGH;
13354 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
13356 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 20); __PYX_ERR(0, 574, __pyx_L3_error)
13358 CYTHON_FALLTHROUGH;
13360 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
13362 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 21); __PYX_ERR(0, 574, __pyx_L3_error)
13364 CYTHON_FALLTHROUGH;
13366 if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
13368 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 22); __PYX_ERR(0, 574, __pyx_L3_error)
13370 CYTHON_FALLTHROUGH;
13372 if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
13374 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 23); __PYX_ERR(0, 574, __pyx_L3_error)
13376 CYTHON_FALLTHROUGH;
13378 if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
13380 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 24); __PYX_ERR(0, 574, __pyx_L3_error)
13382 CYTHON_FALLTHROUGH;
13384 if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementJacobian)) != 0)) kw_args--;
13386 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 25); __PYX_ERR(0, 574, __pyx_L3_error)
13389 if (unlikely(kw_args > 0)) {
13390 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementJacobian") < 0)) __PYX_ERR(0, 574, __pyx_L3_error)
13392 }
else if (PyTuple_GET_SIZE(__pyx_args) != 26) {
13393 goto __pyx_L5_argtuple_error;
13395 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13396 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13397 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13398 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13399 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13400 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13401 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13402 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
13403 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
13404 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
13405 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
13406 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
13407 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
13408 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
13409 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
13410 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
13411 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
13412 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
13413 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
13414 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
13415 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
13416 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
13417 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
13418 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
13419 values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
13420 values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
13422 __pyx_v_gravity = ((PyArrayObject *)values[0]);
13423 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
13424 __pyx_v_colind = ((PyArrayObject *)values[2]);
13425 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L3_error)
13426 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L3_error)
13427 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error)
13428 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
13429 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
13430 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error)
13431 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error)
13432 __pyx_v_q_u = ((PyArrayObject *)values[10]);
13433 __pyx_v_q_grad_u = ((PyArrayObject *)values[11]);
13434 __pyx_v_q_grad_w = ((PyArrayObject *)values[12]);
13435 __pyx_v_q_grad_v = ((PyArrayObject *)values[13]);
13436 __pyx_v_q_detJ = ((PyArrayObject *)values[14]);
13437 __pyx_v_q_m = ((PyArrayObject *)values[15]);
13438 __pyx_v_q_dm = ((PyArrayObject *)values[16]);
13439 __pyx_v_q_mt = ((PyArrayObject *)values[17]);
13440 __pyx_v_q_dmt = ((PyArrayObject *)values[18]);
13441 __pyx_v_q_r = ((PyArrayObject *)values[19]);
13442 __pyx_v_q_kr = ((PyArrayObject *)values[20]);
13443 __pyx_v_q_dkr = ((PyArrayObject *)values[21]);
13444 __pyx_v_q_kr_up = ((PyArrayObject *)values[22]);
13445 __pyx_v_q_flin = ((PyArrayObject *)values[23]);
13446 __pyx_v_q_alin = ((PyArrayObject *)values[24]);
13447 __pyx_v_elementJacobian = ((PyArrayObject *)values[25]);
13449 goto __pyx_L4_argument_unpacking_done;
13450 __pyx_L5_argtuple_error:;
13451 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error)
13453 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
13454 __Pyx_RefNannyFinishContext();
13456 __pyx_L4_argument_unpacking_done:;
13457 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 574, __pyx_L1_error)
13458 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 575, __pyx_L1_error)
13459 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 576, __pyx_L1_error)
13460 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 581, __pyx_L1_error)
13461 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 582, __pyx_L1_error)
13462 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 586, __pyx_L1_error)
13463 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 587, __pyx_L1_error)
13464 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 588, __pyx_L1_error)
13465 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_v), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_v", 0))) __PYX_ERR(0, 589, __pyx_L1_error)
13466 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 591, __pyx_L1_error)
13467 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 592, __pyx_L1_error)
13468 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dm), __pyx_ptype_5numpy_ndarray, 1,
"q_dm", 0))) __PYX_ERR(0, 593, __pyx_L1_error)
13469 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 594, __pyx_L1_error)
13470 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmt), __pyx_ptype_5numpy_ndarray, 1,
"q_dmt", 0))) __PYX_ERR(0, 595, __pyx_L1_error)
13471 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 596, __pyx_L1_error)
13472 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 597, __pyx_L1_error)
13473 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 598, __pyx_L1_error)
13474 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 599, __pyx_L1_error)
13475 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 602, __pyx_L1_error)
13476 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 603, __pyx_L1_error)
13477 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementJacobian), __pyx_ptype_5numpy_ndarray, 1,
"elementJacobian", 0))) __PYX_ERR(0, 605, __pyx_L1_error)
13478 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_grad_v, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_dm, __pyx_v_q_mt, __pyx_v_q_dmt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementJacobian);
13485 __Pyx_RefNannyFinishContext();
13489 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian) {
13490 CYTHON_UNUSED
int __pyx_v_upwindFlag;
13491 CYTHON_UNUSED
int __pyx_v_picard;
13492 PyObject *__pyx_v_q = NULL;
13497 PyArrayObject *__pyx_v_a_up = 0;
13498 PyArrayObject *__pyx_v_f_up = 0;
13499 double __pyx_v_nAvgWeight;
13500 double __pyx_v_weight;
13501 double __pyx_v_volFactor;
13502 CYTHON_UNUSED
int __pyx_v_thisElementIsUpwind;
13503 double __pyx_v_volume;
13507 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
13508 __Pyx_Buffer __pyx_pybuffer_a_up;
13509 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
13510 __Pyx_Buffer __pyx_pybuffer_colind;
13511 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
13512 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
13513 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementJacobian;
13514 __Pyx_Buffer __pyx_pybuffer_elementJacobian;
13515 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
13516 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
13517 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
13518 __Pyx_Buffer __pyx_pybuffer_f_up;
13519 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
13520 __Pyx_Buffer __pyx_pybuffer_gravity;
13521 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
13522 __Pyx_Buffer __pyx_pybuffer_q_alin;
13523 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
13524 __Pyx_Buffer __pyx_pybuffer_q_detJ;
13525 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
13526 __Pyx_Buffer __pyx_pybuffer_q_dkr;
13527 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dm;
13528 __Pyx_Buffer __pyx_pybuffer_q_dm;
13529 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmt;
13530 __Pyx_Buffer __pyx_pybuffer_q_dmt;
13531 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
13532 __Pyx_Buffer __pyx_pybuffer_q_flin;
13533 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
13534 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
13535 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_v;
13536 __Pyx_Buffer __pyx_pybuffer_q_grad_v;
13537 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
13538 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
13539 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
13540 __Pyx_Buffer __pyx_pybuffer_q_kr;
13541 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
13542 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
13543 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
13544 __Pyx_Buffer __pyx_pybuffer_q_m;
13545 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
13546 __Pyx_Buffer __pyx_pybuffer_q_mt;
13547 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
13548 __Pyx_Buffer __pyx_pybuffer_q_r;
13549 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
13550 __Pyx_Buffer __pyx_pybuffer_q_u;
13551 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
13552 __Pyx_Buffer __pyx_pybuffer_rowptr;
13553 PyObject *__pyx_r = NULL;
13554 __Pyx_RefNannyDeclarations
13555 PyObject *__pyx_t_1 = NULL;
13556 PyObject *__pyx_t_2 = NULL;
13557 Py_ssize_t __pyx_t_3;
13558 PyObject *__pyx_t_4 = NULL;
13559 PyObject *__pyx_t_5 = NULL;
13561 Py_ssize_t __pyx_t_7;
13563 PyObject *__pyx_t_9 = NULL;
13564 PyArrayObject *__pyx_t_10 = NULL;
13565 PyArrayObject *__pyx_t_11 = NULL;
13569 Py_ssize_t __pyx_t_15;
13574 Py_ssize_t __pyx_t_20;
13575 Py_ssize_t __pyx_t_21;
13576 Py_ssize_t __pyx_t_22;
13583 Py_ssize_t __pyx_t_29;
13587 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_33;
13588 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_34;
13590 Py_ssize_t __pyx_t_36;
13591 Py_ssize_t __pyx_t_37;
13592 Py_ssize_t __pyx_t_38;
13593 Py_ssize_t __pyx_t_39;
13594 Py_ssize_t __pyx_t_40;
13595 Py_ssize_t __pyx_t_41;
13596 Py_ssize_t __pyx_t_42;
13597 Py_ssize_t __pyx_t_43;
13598 int __pyx_lineno = 0;
13599 const char *__pyx_filename = NULL;
13600 int __pyx_clineno = 0;
13601 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian", 0);
13602 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
13603 __pyx_pybuffer_a_up.refcount = 0;
13604 __pyx_pybuffernd_a_up.data = NULL;
13605 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
13606 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
13607 __pyx_pybuffer_f_up.refcount = 0;
13608 __pyx_pybuffernd_f_up.data = NULL;
13609 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
13610 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
13611 __pyx_pybuffer_gravity.refcount = 0;
13612 __pyx_pybuffernd_gravity.data = NULL;
13613 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
13614 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
13615 __pyx_pybuffer_rowptr.refcount = 0;
13616 __pyx_pybuffernd_rowptr.data = NULL;
13617 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
13618 __pyx_pybuffer_colind.pybuffer.buf = NULL;
13619 __pyx_pybuffer_colind.refcount = 0;
13620 __pyx_pybuffernd_colind.data = NULL;
13621 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
13622 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
13623 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
13624 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
13625 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
13626 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
13627 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
13628 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
13629 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
13630 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
13631 __pyx_pybuffer_q_u.refcount = 0;
13632 __pyx_pybuffernd_q_u.data = NULL;
13633 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
13634 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
13635 __pyx_pybuffer_q_grad_u.refcount = 0;
13636 __pyx_pybuffernd_q_grad_u.data = NULL;
13637 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
13638 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
13639 __pyx_pybuffer_q_grad_w.refcount = 0;
13640 __pyx_pybuffernd_q_grad_w.data = NULL;
13641 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
13642 __pyx_pybuffer_q_grad_v.pybuffer.buf = NULL;
13643 __pyx_pybuffer_q_grad_v.refcount = 0;
13644 __pyx_pybuffernd_q_grad_v.data = NULL;
13645 __pyx_pybuffernd_q_grad_v.rcbuffer = &__pyx_pybuffer_q_grad_v;
13646 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
13647 __pyx_pybuffer_q_detJ.refcount = 0;
13648 __pyx_pybuffernd_q_detJ.data = NULL;
13649 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
13650 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
13651 __pyx_pybuffer_q_m.refcount = 0;
13652 __pyx_pybuffernd_q_m.data = NULL;
13653 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
13654 __pyx_pybuffer_q_dm.pybuffer.buf = NULL;
13655 __pyx_pybuffer_q_dm.refcount = 0;
13656 __pyx_pybuffernd_q_dm.data = NULL;
13657 __pyx_pybuffernd_q_dm.rcbuffer = &__pyx_pybuffer_q_dm;
13658 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
13659 __pyx_pybuffer_q_mt.refcount = 0;
13660 __pyx_pybuffernd_q_mt.data = NULL;
13661 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
13662 __pyx_pybuffer_q_dmt.pybuffer.buf = NULL;
13663 __pyx_pybuffer_q_dmt.refcount = 0;
13664 __pyx_pybuffernd_q_dmt.data = NULL;
13665 __pyx_pybuffernd_q_dmt.rcbuffer = &__pyx_pybuffer_q_dmt;
13666 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
13667 __pyx_pybuffer_q_r.refcount = 0;
13668 __pyx_pybuffernd_q_r.data = NULL;
13669 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
13670 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
13671 __pyx_pybuffer_q_kr.refcount = 0;
13672 __pyx_pybuffernd_q_kr.data = NULL;
13673 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
13674 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
13675 __pyx_pybuffer_q_dkr.refcount = 0;
13676 __pyx_pybuffernd_q_dkr.data = NULL;
13677 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
13678 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
13679 __pyx_pybuffer_q_kr_up.refcount = 0;
13680 __pyx_pybuffernd_q_kr_up.data = NULL;
13681 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
13682 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
13683 __pyx_pybuffer_q_flin.refcount = 0;
13684 __pyx_pybuffernd_q_flin.data = NULL;
13685 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
13686 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
13687 __pyx_pybuffer_q_alin.refcount = 0;
13688 __pyx_pybuffernd_q_alin.data = NULL;
13689 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
13690 __pyx_pybuffer_elementJacobian.pybuffer.buf = NULL;
13691 __pyx_pybuffer_elementJacobian.refcount = 0;
13692 __pyx_pybuffernd_elementJacobian.data = NULL;
13693 __pyx_pybuffernd_elementJacobian.rcbuffer = &__pyx_pybuffer_elementJacobian;
13695 __Pyx_BufFmt_StackElem __pyx_stack[1];
13696 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13698 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
13700 __Pyx_BufFmt_StackElem __pyx_stack[1];
13701 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13703 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
13705 __Pyx_BufFmt_StackElem __pyx_stack[1];
13706 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13708 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
13710 __Pyx_BufFmt_StackElem __pyx_stack[1];
13711 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13713 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
13715 __Pyx_BufFmt_StackElem __pyx_stack[1];
13716 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13718 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
13720 __Pyx_BufFmt_StackElem __pyx_stack[1];
13721 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13723 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
13725 __Pyx_BufFmt_StackElem __pyx_stack[1];
13726 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13728 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
13730 __Pyx_BufFmt_StackElem __pyx_stack[1];
13731 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13733 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
13735 __Pyx_BufFmt_StackElem __pyx_stack[1];
13736 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13738 __pyx_pybuffernd_q_grad_v.diminfo[0].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_v.diminfo[0].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_v.diminfo[1].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_v.diminfo[1].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_v.diminfo[2].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_v.diminfo[2].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_v.diminfo[3].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_v.diminfo[3].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[3];
13740 __Pyx_BufFmt_StackElem __pyx_stack[1];
13741 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13743 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
13745 __Pyx_BufFmt_StackElem __pyx_stack[1];
13746 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13748 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
13750 __Pyx_BufFmt_StackElem __pyx_stack[1];
13751 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13753 __pyx_pybuffernd_q_dm.diminfo[0].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dm.diminfo[0].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dm.diminfo[1].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dm.diminfo[1].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[1];
13755 __Pyx_BufFmt_StackElem __pyx_stack[1];
13756 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13758 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
13760 __Pyx_BufFmt_StackElem __pyx_stack[1];
13761 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13763 __pyx_pybuffernd_q_dmt.diminfo[0].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmt.diminfo[0].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmt.diminfo[1].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmt.diminfo[1].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[1];
13765 __Pyx_BufFmt_StackElem __pyx_stack[1];
13766 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13768 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
13770 __Pyx_BufFmt_StackElem __pyx_stack[1];
13771 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13773 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
13775 __Pyx_BufFmt_StackElem __pyx_stack[1];
13776 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13778 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
13780 __Pyx_BufFmt_StackElem __pyx_stack[1];
13781 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13783 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
13785 __Pyx_BufFmt_StackElem __pyx_stack[1];
13786 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13788 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
13790 __Pyx_BufFmt_StackElem __pyx_stack[1];
13791 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13793 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
13795 __Pyx_BufFmt_StackElem __pyx_stack[1];
13796 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementJacobian, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13798 __pyx_pybuffernd_elementJacobian.diminfo[0].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementJacobian.diminfo[0].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementJacobian.diminfo[1].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementJacobian.diminfo[1].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_elementJacobian.diminfo[2].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_elementJacobian.diminfo[2].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[2];
13807 __pyx_v_upwindFlag = 1;
13816 __pyx_v_picard = 1;
13825 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13826 __Pyx_GOTREF(__pyx_t_1);
13827 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
13828 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
13829 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
13830 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
13831 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
13832 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
13833 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
13834 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
13835 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
13836 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
13837 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
13838 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
13839 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
13840 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
13841 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
13842 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
13843 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13845 if (__pyx_t_3 >= 5)
break;
13846 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13847 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 623, __pyx_L1_error)
13849 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13850 __Pyx_GOTREF(__pyx_t_1);
13852 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
13862 #ifndef CYTHON_WITHOUT_ASSERTIONS
13863 if (unlikely(!Py_OptimizeFlag)) {
13864 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13865 __Pyx_GOTREF(__pyx_t_1);
13866 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error)
13867 __Pyx_GOTREF(__pyx_t_4);
13868 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13869 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13870 __Pyx_GOTREF(__pyx_t_1);
13871 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error)
13872 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13874 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 624, __pyx_L1_error)
13875 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13876 if (unlikely(!__pyx_t_6)) {
13877 PyErr_SetNone(PyExc_AssertionError);
13878 __PYX_ERR(0, 624, __pyx_L1_error)
13891 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13900 #ifndef CYTHON_WITHOUT_ASSERTIONS
13901 if (unlikely(!Py_OptimizeFlag)) {
13902 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
13903 PyErr_SetNone(PyExc_AssertionError);
13904 __PYX_ERR(0, 625, __pyx_L1_error)
13916 __pyx_t_7 = __pyx_v_nSpace;
13918 if (__pyx_t_7 < 0) {
13919 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13920 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
13921 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
13922 if (unlikely(__pyx_t_8 != -1)) {
13923 __Pyx_RaiseBufferIndexError(__pyx_t_8);
13924 __PYX_ERR(0, 626, __pyx_L1_error)
13926 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
13935 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
13936 __Pyx_GOTREF(__pyx_t_5);
13937 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
13938 __Pyx_GOTREF(__pyx_t_1);
13939 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13940 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
13941 __Pyx_GOTREF(__pyx_t_5);
13944 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
13945 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
13946 if (likely(__pyx_t_4)) {
13947 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
13948 __Pyx_INCREF(__pyx_t_4);
13949 __Pyx_INCREF(
function);
13950 __Pyx_DECREF_SET(__pyx_t_1,
function);
13954 #if CYTHON_FAST_PYCALL
13955 if (PyFunction_Check(__pyx_t_1)) {
13956 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
13957 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
13958 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13959 __Pyx_GOTREF(__pyx_t_2);
13960 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13963 #if CYTHON_FAST_PYCCALL
13964 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
13965 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
13966 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
13967 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13968 __Pyx_GOTREF(__pyx_t_2);
13969 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13973 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 630, __pyx_L1_error)
13974 __Pyx_GOTREF(__pyx_t_9);
13976 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
13978 __Pyx_GIVEREF(__pyx_t_5);
13979 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
13980 __Pyx_INCREF(__pyx_n_s_d);
13981 __Pyx_GIVEREF(__pyx_n_s_d);
13982 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
13984 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
13985 __Pyx_GOTREF(__pyx_t_2);
13986 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13989 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 630, __pyx_L1_error)
13990 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
13992 __Pyx_BufFmt_StackElem __pyx_stack[1];
13993 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
13994 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
13995 __PYX_ERR(0, 630, __pyx_L1_error)
13996 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
14000 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
14010 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
14011 __Pyx_GOTREF(__pyx_t_1);
14012 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 631, __pyx_L1_error)
14013 __Pyx_GOTREF(__pyx_t_9);
14014 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14015 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
14016 __Pyx_GOTREF(__pyx_t_1);
14019 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14020 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
14021 if (likely(__pyx_t_5)) {
14022 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14023 __Pyx_INCREF(__pyx_t_5);
14024 __Pyx_INCREF(
function);
14025 __Pyx_DECREF_SET(__pyx_t_9,
function);
14029 #if CYTHON_FAST_PYCALL
14030 if (PyFunction_Check(__pyx_t_9)) {
14031 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
14032 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14033 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14034 __Pyx_GOTREF(__pyx_t_2);
14035 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14038 #if CYTHON_FAST_PYCCALL
14039 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14040 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
14041 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14042 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14043 __Pyx_GOTREF(__pyx_t_2);
14044 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14048 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
14049 __Pyx_GOTREF(__pyx_t_4);
14051 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
14053 __Pyx_GIVEREF(__pyx_t_1);
14054 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
14055 __Pyx_INCREF(__pyx_n_s_d);
14056 __Pyx_GIVEREF(__pyx_n_s_d);
14057 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
14059 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14060 __Pyx_GOTREF(__pyx_t_2);
14061 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14063 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14064 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error)
14065 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
14067 __Pyx_BufFmt_StackElem __pyx_stack[1];
14068 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
14069 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
14070 __PYX_ERR(0, 631, __pyx_L1_error)
14071 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
14075 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
14085 __pyx_t_12 = (__pyx_v_nSpace + 1.);
14086 if (unlikely(__pyx_t_12 == 0)) {
14087 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
14088 __PYX_ERR(0, 633, __pyx_L1_error)
14090 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
14099 __pyx_v_weight = 1.0;
14100 __pyx_v_volFactor = 1.0;
14109 __pyx_v_thisElementIsUpwind = 1;
14118 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
14128 __pyx_v_volFactor = 0.5;
14146 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
14156 __pyx_v_volFactor = (1.0 / 6.0);
14174 __pyx_t_8 = __pyx_v_nElements_global;
14175 __pyx_t_13 = __pyx_t_8;
14176 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
14177 __pyx_v_eN = __pyx_t_14;
14186 __pyx_t_7 = __pyx_v_eN;
14189 if (__pyx_t_7 < 0) {
14190 __pyx_t_7 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
14191 if (unlikely(__pyx_t_7 < 0)) __pyx_t_16 = 0;
14192 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_16 = 0;
14193 if (__pyx_t_15 < 0) {
14194 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
14195 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
14196 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_16 = 1;
14197 if (unlikely(__pyx_t_16 != -1)) {
14198 __Pyx_RaiseBufferIndexError(__pyx_t_16);
14199 __PYX_ERR(0, 642, __pyx_L1_error)
14201 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
14210 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
14219 __pyx_t_16 = __pyx_v_nDOF_test_element;
14220 __pyx_t_17 = __pyx_t_16;
14221 for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
14222 __pyx_v_i = __pyx_t_18;
14231 __pyx_t_15 = __pyx_v_eN;
14232 __pyx_t_7 = __pyx_v_i;
14234 if (__pyx_t_15 < 0) {
14235 __pyx_t_15 += __pyx_pybuffernd_q_dmt.diminfo[0].shape;
14236 if (unlikely(__pyx_t_15 < 0)) __pyx_t_19 = 0;
14237 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_dmt.diminfo[0].shape)) __pyx_t_19 = 0;
14238 if (__pyx_t_7 < 0) {
14239 __pyx_t_7 += __pyx_pybuffernd_q_dmt.diminfo[1].shape;
14240 if (unlikely(__pyx_t_7 < 0)) __pyx_t_19 = 1;
14241 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_dmt.diminfo[1].shape)) __pyx_t_19 = 1;
14242 if (unlikely(__pyx_t_19 != -1)) {
14243 __Pyx_RaiseBufferIndexError(__pyx_t_19);
14244 __PYX_ERR(0, 650, __pyx_L1_error)
14246 __pyx_t_20 = __pyx_v_eN;
14247 __pyx_t_21 = __pyx_v_i;
14248 __pyx_t_22 = __pyx_v_i;
14250 if (__pyx_t_20 < 0) {
14251 __pyx_t_20 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
14252 if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 0;
14253 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_19 = 0;
14254 if (__pyx_t_21 < 0) {
14255 __pyx_t_21 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
14256 if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 1;
14257 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_19 = 1;
14258 if (__pyx_t_22 < 0) {
14259 __pyx_t_22 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
14260 if (unlikely(__pyx_t_22 < 0)) __pyx_t_19 = 2;
14261 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_19 = 2;
14262 if (unlikely(__pyx_t_19 != -1)) {
14263 __Pyx_RaiseBufferIndexError(__pyx_t_19);
14264 __PYX_ERR(0, 650, __pyx_L1_error)
14266 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_dmt.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_dmt.diminfo[1].strides)));
14275 __pyx_t_19 = __pyx_v_nElementBoundaries_element;
14276 __pyx_t_23 = __pyx_t_19;
14277 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
14278 __pyx_v_ebN = __pyx_t_24;
14287 __pyx_t_25 = __pyx_v_nnz;
14288 __pyx_t_26 = __pyx_t_25;
14289 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
14290 __pyx_v_ii = __pyx_t_27;
14299 __pyx_t_7 = __pyx_v_eN;
14300 __pyx_t_15 = __pyx_v_ebN;
14301 __pyx_t_22 = __pyx_v_ii;
14303 if (__pyx_t_7 < 0) {
14304 __pyx_t_7 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
14305 if (unlikely(__pyx_t_7 < 0)) __pyx_t_28 = 0;
14306 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_28 = 0;
14307 if (__pyx_t_15 < 0) {
14308 __pyx_t_15 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
14309 if (unlikely(__pyx_t_15 < 0)) __pyx_t_28 = 1;
14310 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_28 = 1;
14311 if (__pyx_t_22 < 0) {
14312 __pyx_t_22 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
14313 if (unlikely(__pyx_t_22 < 0)) __pyx_t_28 = 2;
14314 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_28 = 2;
14315 if (unlikely(__pyx_t_28 != -1)) {
14316 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14317 __PYX_ERR(0, 656, __pyx_L1_error)
14319 __pyx_t_21 = __pyx_v_eN;
14320 __pyx_t_20 = __pyx_v_ebN;
14322 if (__pyx_t_21 < 0) {
14323 __pyx_t_21 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
14324 if (unlikely(__pyx_t_21 < 0)) __pyx_t_28 = 0;
14325 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_28 = 0;
14326 if (__pyx_t_20 < 0) {
14327 __pyx_t_20 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
14328 if (unlikely(__pyx_t_20 < 0)) __pyx_t_28 = 1;
14329 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_28 = 1;
14330 if (unlikely(__pyx_t_28 != -1)) {
14331 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14332 __PYX_ERR(0, 656, __pyx_L1_error)
14334 __pyx_t_29 = __pyx_v_ii;
14336 if (__pyx_t_29 < 0) {
14337 __pyx_t_29 += __pyx_pybuffernd_a_up.diminfo[0].shape;
14338 if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
14339 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_28 = 0;
14340 if (unlikely(__pyx_t_28 != -1)) {
14341 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14342 __PYX_ERR(0, 656, __pyx_L1_error)
14344 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
14354 __pyx_t_25 = __pyx_v_nSpace;
14355 __pyx_t_26 = __pyx_t_25;
14356 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
14357 __pyx_v_I = __pyx_t_27;
14366 __pyx_t_20 = __pyx_v_eN;
14367 __pyx_t_21 = __pyx_v_ebN;
14368 __pyx_t_22 = __pyx_v_I;
14370 if (__pyx_t_20 < 0) {
14371 __pyx_t_20 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
14372 if (unlikely(__pyx_t_20 < 0)) __pyx_t_28 = 0;
14373 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_28 = 0;
14374 if (__pyx_t_21 < 0) {
14375 __pyx_t_21 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
14376 if (unlikely(__pyx_t_21 < 0)) __pyx_t_28 = 1;
14377 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_28 = 1;
14378 if (__pyx_t_22 < 0) {
14379 __pyx_t_22 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
14380 if (unlikely(__pyx_t_22 < 0)) __pyx_t_28 = 2;
14381 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_28 = 2;
14382 if (unlikely(__pyx_t_28 != -1)) {
14383 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14384 __PYX_ERR(0, 658, __pyx_L1_error)
14386 __pyx_t_15 = __pyx_v_eN;
14387 __pyx_t_7 = __pyx_v_ebN;
14389 if (__pyx_t_15 < 0) {
14390 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
14391 if (unlikely(__pyx_t_15 < 0)) __pyx_t_28 = 0;
14392 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_28 = 0;
14393 if (__pyx_t_7 < 0) {
14394 __pyx_t_7 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
14395 if (unlikely(__pyx_t_7 < 0)) __pyx_t_28 = 1;
14396 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_28 = 1;
14397 if (unlikely(__pyx_t_28 != -1)) {
14398 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14399 __PYX_ERR(0, 658, __pyx_L1_error)
14401 __pyx_t_29 = __pyx_v_I;
14403 if (__pyx_t_29 < 0) {
14404 __pyx_t_29 += __pyx_pybuffernd_f_up.diminfo[0].shape;
14405 if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
14406 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_28 = 0;
14407 if (unlikely(__pyx_t_28 != -1)) {
14408 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14409 __PYX_ERR(0, 658, __pyx_L1_error)
14411 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
14421 __pyx_t_25 = __pyx_v_nDOF_trial_element;
14422 __pyx_t_26 = __pyx_t_25;
14423 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
14424 __pyx_v_j = __pyx_t_27;
14433 __pyx_t_28 = __pyx_v_nSpace;
14434 __pyx_t_30 = __pyx_t_28;
14435 for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
14436 __pyx_v_I = __pyx_t_31;
14445 __pyx_t_7 = (__pyx_v_I + 1);
14447 if (__pyx_t_7 < 0) {
14448 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14449 if (unlikely(__pyx_t_7 < 0)) __pyx_t_32 = 0;
14450 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_32 = 0;
14451 if (unlikely(__pyx_t_32 != -1)) {
14452 __Pyx_RaiseBufferIndexError(__pyx_t_32);
14453 __PYX_ERR(0, 664, __pyx_L1_error)
14455 __pyx_t_33 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
14456 __pyx_t_7 = __pyx_v_I;
14458 if (__pyx_t_7 < 0) {
14459 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14460 if (unlikely(__pyx_t_7 < 0)) __pyx_t_32 = 0;
14461 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_32 = 0;
14462 if (unlikely(__pyx_t_32 != -1)) {
14463 __Pyx_RaiseBufferIndexError(__pyx_t_32);
14464 __PYX_ERR(0, 664, __pyx_L1_error)
14466 __pyx_t_34 = __pyx_t_33;
14467 for (__pyx_t_32 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_32 < __pyx_t_34; __pyx_t_32+=1) {
14468 __pyx_v_ii = __pyx_t_32;
14477 __pyx_t_15 = __pyx_v_ii;
14479 if (__pyx_t_15 < 0) {
14480 __pyx_t_15 += __pyx_pybuffernd_a_up.diminfo[0].shape;
14481 if (unlikely(__pyx_t_15 < 0)) __pyx_t_35 = 0;
14482 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_35 = 0;
14483 if (unlikely(__pyx_t_35 != -1)) {
14484 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14485 __PYX_ERR(0, 665, __pyx_L1_error)
14487 __pyx_t_22 = __pyx_v_ii;
14489 if (__pyx_t_22 < 0) {
14490 __pyx_t_22 += __pyx_pybuffernd_colind.diminfo[0].shape;
14491 if (unlikely(__pyx_t_22 < 0)) __pyx_t_35 = 0;
14492 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_35 = 0;
14493 if (unlikely(__pyx_t_35 != -1)) {
14494 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14495 __PYX_ERR(0, 665, __pyx_L1_error)
14497 __pyx_t_21 = __pyx_v_eN;
14498 __pyx_t_20 = __pyx_v_ebN;
14499 __pyx_t_29 = __pyx_v_j;
14500 __pyx_t_36 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_colind.diminfo[0].strides));
14502 if (__pyx_t_21 < 0) {
14503 __pyx_t_21 += __pyx_pybuffernd_q_grad_v.diminfo[0].shape;
14504 if (unlikely(__pyx_t_21 < 0)) __pyx_t_35 = 0;
14505 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_grad_v.diminfo[0].shape)) __pyx_t_35 = 0;
14506 if (__pyx_t_20 < 0) {
14507 __pyx_t_20 += __pyx_pybuffernd_q_grad_v.diminfo[1].shape;
14508 if (unlikely(__pyx_t_20 < 0)) __pyx_t_35 = 1;
14509 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_grad_v.diminfo[1].shape)) __pyx_t_35 = 1;
14510 if (__pyx_t_29 < 0) {
14511 __pyx_t_29 += __pyx_pybuffernd_q_grad_v.diminfo[2].shape;
14512 if (unlikely(__pyx_t_29 < 0)) __pyx_t_35 = 2;
14513 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_q_grad_v.diminfo[2].shape)) __pyx_t_35 = 2;
14514 if (__pyx_t_36 < 0) {
14515 __pyx_t_36 += __pyx_pybuffernd_q_grad_v.diminfo[3].shape;
14516 if (unlikely(__pyx_t_36 < 0)) __pyx_t_35 = 3;
14517 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_grad_v.diminfo[3].shape)) __pyx_t_35 = 3;
14518 if (unlikely(__pyx_t_35 != -1)) {
14519 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14520 __PYX_ERR(0, 665, __pyx_L1_error)
14522 __pyx_t_37 = __pyx_v_eN;
14523 __pyx_t_38 = __pyx_v_ebN;
14524 __pyx_t_39 = __pyx_v_i;
14525 __pyx_t_40 = __pyx_v_I;
14527 if (__pyx_t_37 < 0) {
14528 __pyx_t_37 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
14529 if (unlikely(__pyx_t_37 < 0)) __pyx_t_35 = 0;
14530 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_35 = 0;
14531 if (__pyx_t_38 < 0) {
14532 __pyx_t_38 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
14533 if (unlikely(__pyx_t_38 < 0)) __pyx_t_35 = 1;
14534 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_35 = 1;
14535 if (__pyx_t_39 < 0) {
14536 __pyx_t_39 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
14537 if (unlikely(__pyx_t_39 < 0)) __pyx_t_35 = 2;
14538 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_35 = 2;
14539 if (__pyx_t_40 < 0) {
14540 __pyx_t_40 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
14541 if (unlikely(__pyx_t_40 < 0)) __pyx_t_35 = 3;
14542 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_35 = 3;
14543 if (unlikely(__pyx_t_35 != -1)) {
14544 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14545 __PYX_ERR(0, 665, __pyx_L1_error)
14547 __pyx_t_41 = __pyx_v_eN;
14548 __pyx_t_42 = __pyx_v_i;
14549 __pyx_t_43 = __pyx_v_j;
14551 if (__pyx_t_41 < 0) {
14552 __pyx_t_41 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
14553 if (unlikely(__pyx_t_41 < 0)) __pyx_t_35 = 0;
14554 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_35 = 0;
14555 if (__pyx_t_42 < 0) {
14556 __pyx_t_42 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
14557 if (unlikely(__pyx_t_42 < 0)) __pyx_t_35 = 1;
14558 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_35 = 1;
14559 if (__pyx_t_43 < 0) {
14560 __pyx_t_43 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
14561 if (unlikely(__pyx_t_43 < 0)) __pyx_t_35 = 2;
14562 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_35 = 2;
14563 if (unlikely(__pyx_t_35 != -1)) {
14564 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14565 __PYX_ERR(0, 665, __pyx_L1_error)
14567 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_q_grad_v.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_q_grad_v.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_q_grad_v.diminfo[2].strides, __pyx_t_36, __pyx_pybuffernd_q_grad_v.diminfo[3].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_40, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
14584 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14587 __Pyx_XDECREF(__pyx_t_1);
14588 __Pyx_XDECREF(__pyx_t_2);
14589 __Pyx_XDECREF(__pyx_t_4);
14590 __Pyx_XDECREF(__pyx_t_5);
14591 __Pyx_XDECREF(__pyx_t_9);
14592 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14593 __Pyx_PyThreadState_declare
14594 __Pyx_PyThreadState_assign
14595 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14596 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14597 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14598 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14599 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14600 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14601 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14602 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14603 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14604 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14605 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14606 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14607 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14608 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14609 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14610 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14611 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14612 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14613 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14614 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14615 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14616 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14617 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14618 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14619 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14620 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
14624 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14625 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14626 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14627 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14628 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14629 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14630 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14631 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14632 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14633 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14634 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14635 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14636 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14637 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14638 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14639 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14640 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14641 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14642 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14643 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14644 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14645 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14646 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14648 __Pyx_XDECREF(__pyx_v_q);
14649 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
14650 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
14651 __Pyx_XGIVEREF(__pyx_r);
14652 __Pyx_RefNannyFinishContext();
14665 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14666 static char __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg[] =
"\n approximate element mass term as (\010ar{c}_e,w_{h,i})_e\n ";
14667 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg = {
"updateMass_weakAvg", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg};
14668 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14669 PyArrayObject *__pyx_v_mt = 0;
14670 PyArrayObject *__pyx_v_w = 0;
14671 PyArrayObject *__pyx_v_dV = 0;
14672 PyArrayObject *__pyx_v_weak_residual = 0;
14673 int __pyx_lineno = 0;
14674 const char *__pyx_filename = NULL;
14675 int __pyx_clineno = 0;
14676 PyObject *__pyx_r = 0;
14677 __Pyx_RefNannyDeclarations
14678 __Pyx_RefNannySetupContext(
"updateMass_weakAvg (wrapper)", 0);
14680 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mt,&__pyx_n_s_w,&__pyx_n_s_dV,&__pyx_n_s_weak_residual,0};
14681 PyObject* values[4] = {0,0,0,0};
14682 if (unlikely(__pyx_kwds)) {
14683 Py_ssize_t kw_args;
14684 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14685 switch (pos_args) {
14686 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14687 CYTHON_FALLTHROUGH;
14688 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14689 CYTHON_FALLTHROUGH;
14690 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14691 CYTHON_FALLTHROUGH;
14692 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14693 CYTHON_FALLTHROUGH;
14695 default:
goto __pyx_L5_argtuple_error;
14697 kw_args = PyDict_Size(__pyx_kwds);
14698 switch (pos_args) {
14700 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mt)) != 0)) kw_args--;
14701 else goto __pyx_L5_argtuple_error;
14702 CYTHON_FALLTHROUGH;
14704 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
14706 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 1); __PYX_ERR(0, 673, __pyx_L3_error)
14708 CYTHON_FALLTHROUGH;
14710 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
14712 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 2); __PYX_ERR(0, 673, __pyx_L3_error)
14714 CYTHON_FALLTHROUGH;
14716 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weak_residual)) != 0)) kw_args--;
14718 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 3); __PYX_ERR(0, 673, __pyx_L3_error)
14721 if (unlikely(kw_args > 0)) {
14722 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMass_weakAvg") < 0)) __PYX_ERR(0, 673, __pyx_L3_error)
14724 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
14725 goto __pyx_L5_argtuple_error;
14727 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14728 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14729 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14730 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14732 __pyx_v_mt = ((PyArrayObject *)values[0]);
14733 __pyx_v_w = ((PyArrayObject *)values[1]);
14734 __pyx_v_dV = ((PyArrayObject *)values[2]);
14735 __pyx_v_weak_residual = ((PyArrayObject *)values[3]);
14737 goto __pyx_L4_argument_unpacking_done;
14738 __pyx_L5_argtuple_error:;
14739 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 673, __pyx_L3_error)
14741 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
14742 __Pyx_RefNannyFinishContext();
14744 __pyx_L4_argument_unpacking_done:;
14745 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mt), __pyx_ptype_5numpy_ndarray, 1,
"mt", 0))) __PYX_ERR(0, 673, __pyx_L1_error)
14746 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 674, __pyx_L1_error)
14747 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 675, __pyx_L1_error)
14748 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"weak_residual", 0))) __PYX_ERR(0, 676, __pyx_L1_error)
14749 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(__pyx_self, __pyx_v_mt, __pyx_v_w, __pyx_v_dV, __pyx_v_weak_residual);
14756 __Pyx_RefNannyFinishContext();
14760 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual) {
14764 PyObject *__pyx_v_mt_avg = 0;
14765 PyObject *__pyx_v_vol = 0;
14766 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
14767 __Pyx_Buffer __pyx_pybuffer_dV;
14768 __Pyx_LocalBuf_ND __pyx_pybuffernd_mt;
14769 __Pyx_Buffer __pyx_pybuffer_mt;
14770 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
14771 __Pyx_Buffer __pyx_pybuffer_w;
14772 __Pyx_LocalBuf_ND __pyx_pybuffernd_weak_residual;
14773 __Pyx_Buffer __pyx_pybuffer_weak_residual;
14774 PyObject *__pyx_r = NULL;
14775 __Pyx_RefNannyDeclarations
14776 npy_intp __pyx_t_1;
14777 npy_intp __pyx_t_2;
14779 npy_intp __pyx_t_4;
14780 npy_intp __pyx_t_5;
14782 Py_ssize_t __pyx_t_7;
14783 Py_ssize_t __pyx_t_8;
14785 Py_ssize_t __pyx_t_10;
14786 Py_ssize_t __pyx_t_11;
14787 PyObject *__pyx_t_12 = NULL;
14788 PyObject *__pyx_t_13 = NULL;
14789 PyObject *__pyx_t_14 = NULL;
14791 int __pyx_lineno = 0;
14792 const char *__pyx_filename = NULL;
14793 int __pyx_clineno = 0;
14794 __Pyx_RefNannySetupContext(
"updateMass_weakAvg", 0);
14795 __pyx_pybuffer_mt.pybuffer.buf = NULL;
14796 __pyx_pybuffer_mt.refcount = 0;
14797 __pyx_pybuffernd_mt.data = NULL;
14798 __pyx_pybuffernd_mt.rcbuffer = &__pyx_pybuffer_mt;
14799 __pyx_pybuffer_w.pybuffer.buf = NULL;
14800 __pyx_pybuffer_w.refcount = 0;
14801 __pyx_pybuffernd_w.data = NULL;
14802 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
14803 __pyx_pybuffer_dV.pybuffer.buf = NULL;
14804 __pyx_pybuffer_dV.refcount = 0;
14805 __pyx_pybuffernd_dV.data = NULL;
14806 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
14807 __pyx_pybuffer_weak_residual.pybuffer.buf = NULL;
14808 __pyx_pybuffer_weak_residual.refcount = 0;
14809 __pyx_pybuffernd_weak_residual.data = NULL;
14810 __pyx_pybuffernd_weak_residual.rcbuffer = &__pyx_pybuffer_weak_residual;
14812 __Pyx_BufFmt_StackElem __pyx_stack[1];
14813 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14815 __pyx_pybuffernd_mt.diminfo[0].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mt.diminfo[0].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mt.diminfo[1].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mt.diminfo[1].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[1];
14817 __Pyx_BufFmt_StackElem __pyx_stack[1];
14818 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14820 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
14822 __Pyx_BufFmt_StackElem __pyx_stack[1];
14823 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14825 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
14827 __Pyx_BufFmt_StackElem __pyx_stack[1];
14828 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14830 __pyx_pybuffernd_weak_residual.diminfo[0].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weak_residual.diminfo[0].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weak_residual.diminfo[1].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weak_residual.diminfo[1].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[1];
14839 __pyx_t_1 = (__pyx_v_mt->dimensions[0]);
14840 __pyx_t_2 = __pyx_t_1;
14841 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
14842 __pyx_v_eN = __pyx_t_3;
14851 __Pyx_INCREF(__pyx_float_0_0);
14852 __Pyx_XDECREF_SET(__pyx_v_mt_avg, __pyx_float_0_0);
14861 __Pyx_INCREF(__pyx_float_0_0);
14862 __Pyx_XDECREF_SET(__pyx_v_vol, __pyx_float_0_0);
14871 __pyx_t_4 = (__pyx_v_mt->dimensions[1]);
14872 __pyx_t_5 = __pyx_t_4;
14873 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14874 __pyx_v_k = __pyx_t_6;
14883 __pyx_t_7 = __pyx_v_eN;
14884 __pyx_t_8 = __pyx_v_k;
14886 if (__pyx_t_7 < 0) {
14887 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
14888 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
14889 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
14890 if (__pyx_t_8 < 0) {
14891 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
14892 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
14893 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
14894 if (unlikely(__pyx_t_9 != -1)) {
14895 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14896 __PYX_ERR(0, 686, __pyx_L1_error)
14898 __pyx_t_10 = __pyx_v_eN;
14899 __pyx_t_11 = __pyx_v_k;
14901 if (__pyx_t_10 < 0) {
14902 __pyx_t_10 += __pyx_pybuffernd_mt.diminfo[0].shape;
14903 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
14904 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_mt.diminfo[0].shape)) __pyx_t_9 = 0;
14905 if (__pyx_t_11 < 0) {
14906 __pyx_t_11 += __pyx_pybuffernd_mt.diminfo[1].shape;
14907 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
14908 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_mt.diminfo[1].shape)) __pyx_t_9 = 1;
14909 if (unlikely(__pyx_t_9 != -1)) {
14910 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14911 __PYX_ERR(0, 686, __pyx_L1_error)
14913 __pyx_t_12 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_mt.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_mt.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_mt.diminfo[1].strides))));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 686, __pyx_L1_error)
14914 __Pyx_GOTREF(__pyx_t_12);
14915 __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_mt_avg, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 686, __pyx_L1_error)
14916 __Pyx_GOTREF(__pyx_t_13);
14917 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14918 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_13);
14928 __pyx_t_11 = __pyx_v_eN;
14929 __pyx_t_10 = __pyx_v_k;
14931 if (__pyx_t_11 < 0) {
14932 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[0].shape;
14933 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
14934 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
14935 if (__pyx_t_10 < 0) {
14936 __pyx_t_10 += __pyx_pybuffernd_dV.diminfo[1].shape;
14937 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 1;
14938 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
14939 if (unlikely(__pyx_t_9 != -1)) {
14940 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14941 __PYX_ERR(0, 687, __pyx_L1_error)
14943 __pyx_t_13 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 687, __pyx_L1_error)
14944 __Pyx_GOTREF(__pyx_t_13);
14945 __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_vol, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 687, __pyx_L1_error)
14946 __Pyx_GOTREF(__pyx_t_12);
14947 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
14948 __Pyx_DECREF_SET(__pyx_v_vol, __pyx_t_12);
14959 __pyx_t_12 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_mt_avg, __pyx_v_vol);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 688, __pyx_L1_error)
14960 __Pyx_GOTREF(__pyx_t_12);
14961 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_12);
14971 __pyx_t_4 = (__pyx_v_weak_residual->dimensions[1]);
14972 __pyx_t_5 = __pyx_t_4;
14973 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14974 __pyx_v_i = __pyx_t_6;
14983 __pyx_t_10 = __pyx_v_eN;
14984 __pyx_t_11 = __pyx_v_k;
14985 __pyx_t_8 = __pyx_v_i;
14987 if (__pyx_t_10 < 0) {
14988 __pyx_t_10 += __pyx_pybuffernd_w.diminfo[0].shape;
14989 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
14990 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_9 = 0;
14991 if (__pyx_t_11 < 0) {
14992 __pyx_t_11 += __pyx_pybuffernd_w.diminfo[1].shape;
14993 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
14994 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_9 = 1;
14995 if (__pyx_t_8 < 0) {
14996 __pyx_t_8 += __pyx_pybuffernd_w.diminfo[2].shape;
14997 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 2;
14998 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_9 = 2;
14999 if (unlikely(__pyx_t_9 != -1)) {
15000 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15001 __PYX_ERR(0, 691, __pyx_L1_error)
15003 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_w.diminfo[2].strides)));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error)
15004 __Pyx_GOTREF(__pyx_t_12);
15005 __pyx_t_13 = PyNumber_Multiply(__pyx_v_mt_avg, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 691, __pyx_L1_error)
15006 __Pyx_GOTREF(__pyx_t_13);
15007 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15008 __pyx_t_8 = __pyx_v_eN;
15009 __pyx_t_11 = __pyx_v_k;
15011 if (__pyx_t_8 < 0) {
15012 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
15013 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
15014 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15015 if (__pyx_t_11 < 0) {
15016 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[1].shape;
15017 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
15018 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15019 if (unlikely(__pyx_t_9 != -1)) {
15020 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15021 __PYX_ERR(0, 691, __pyx_L1_error)
15023 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error)
15024 __Pyx_GOTREF(__pyx_t_12);
15025 __pyx_t_14 = PyNumber_Multiply(__pyx_t_13, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 691, __pyx_L1_error)
15026 __Pyx_GOTREF(__pyx_t_14);
15027 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
15028 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15029 __pyx_t_15 = __Pyx_PyObject_AsDouble(__pyx_t_14);
if (unlikely(__pyx_t_15 == ((
double)((
double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L1_error)
15030 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
15031 __pyx_t_11 = __pyx_v_eN;
15032 __pyx_t_8 = __pyx_v_i;
15034 if (__pyx_t_11 < 0) {
15035 __pyx_t_11 += __pyx_pybuffernd_weak_residual.diminfo[0].shape;
15036 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
15037 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_weak_residual.diminfo[0].shape)) __pyx_t_9 = 0;
15038 if (__pyx_t_8 < 0) {
15039 __pyx_t_8 += __pyx_pybuffernd_weak_residual.diminfo[1].shape;
15040 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
15041 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_weak_residual.diminfo[1].shape)) __pyx_t_9 = 1;
15042 if (unlikely(__pyx_t_9 != -1)) {
15043 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15044 __PYX_ERR(0, 691, __pyx_L1_error)
15046 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_weak_residual.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_weak_residual.diminfo[1].strides) += __pyx_t_15;
15059 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15062 __Pyx_XDECREF(__pyx_t_12);
15063 __Pyx_XDECREF(__pyx_t_13);
15064 __Pyx_XDECREF(__pyx_t_14);
15065 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15066 __Pyx_PyThreadState_declare
15067 __Pyx_PyThreadState_assign
15068 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15069 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15070 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
15071 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15072 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
15073 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15074 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15078 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15079 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
15080 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15081 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
15083 __Pyx_XDECREF(__pyx_v_mt_avg);
15084 __Pyx_XDECREF(__pyx_v_vol);
15085 __Pyx_XGIVEREF(__pyx_r);
15086 __Pyx_RefNannyFinishContext();
15099 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15100 static char __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg[] =
"\n approximate element mass Jacobian term as (\\pd{\010ar{c}_e}{u_j},w_{h,i})_e\n ";
15101 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg = {
"updateMassJacobian_weakAvg", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg};
15102 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15103 PyArrayObject *__pyx_v_dmt = 0;
15104 PyArrayObject *__pyx_v_w = 0;
15105 PyArrayObject *__pyx_v_v = 0;
15106 PyArrayObject *__pyx_v_dV = 0;
15107 PyArrayObject *__pyx_v_jacobian_weak_residual = 0;
15108 int __pyx_lineno = 0;
15109 const char *__pyx_filename = NULL;
15110 int __pyx_clineno = 0;
15111 PyObject *__pyx_r = 0;
15112 __Pyx_RefNannyDeclarations
15113 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg (wrapper)", 0);
15115 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmt,&__pyx_n_s_w,&__pyx_n_s_v,&__pyx_n_s_dV,&__pyx_n_s_jacobian_weak_residual,0};
15116 PyObject* values[5] = {0,0,0,0,0};
15117 if (unlikely(__pyx_kwds)) {
15118 Py_ssize_t kw_args;
15119 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15120 switch (pos_args) {
15121 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15122 CYTHON_FALLTHROUGH;
15123 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15124 CYTHON_FALLTHROUGH;
15125 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15126 CYTHON_FALLTHROUGH;
15127 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15128 CYTHON_FALLTHROUGH;
15129 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15130 CYTHON_FALLTHROUGH;
15132 default:
goto __pyx_L5_argtuple_error;
15134 kw_args = PyDict_Size(__pyx_kwds);
15135 switch (pos_args) {
15137 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
15138 else goto __pyx_L5_argtuple_error;
15139 CYTHON_FALLTHROUGH;
15141 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
15143 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 1); __PYX_ERR(0, 692, __pyx_L3_error)
15145 CYTHON_FALLTHROUGH;
15147 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15149 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 2); __PYX_ERR(0, 692, __pyx_L3_error)
15151 CYTHON_FALLTHROUGH;
15153 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
15155 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 3); __PYX_ERR(0, 692, __pyx_L3_error)
15157 CYTHON_FALLTHROUGH;
15159 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian_weak_residual)) != 0)) kw_args--;
15161 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 4); __PYX_ERR(0, 692, __pyx_L3_error)
15164 if (unlikely(kw_args > 0)) {
15165 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMassJacobian_weakAvg") < 0)) __PYX_ERR(0, 692, __pyx_L3_error)
15167 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
15168 goto __pyx_L5_argtuple_error;
15170 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15171 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15172 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15173 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15174 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15176 __pyx_v_dmt = ((PyArrayObject *)values[0]);
15177 __pyx_v_w = ((PyArrayObject *)values[1]);
15178 __pyx_v_v = ((PyArrayObject *)values[2]);
15179 __pyx_v_dV = ((PyArrayObject *)values[3]);
15180 __pyx_v_jacobian_weak_residual = ((PyArrayObject *)values[4]);
15182 goto __pyx_L4_argument_unpacking_done;
15183 __pyx_L5_argtuple_error:;
15184 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 692, __pyx_L3_error)
15186 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15187 __Pyx_RefNannyFinishContext();
15189 __pyx_L4_argument_unpacking_done:;
15190 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1,
"dmt", 0))) __PYX_ERR(0, 692, __pyx_L1_error)
15191 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 693, __pyx_L1_error)
15192 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 694, __pyx_L1_error)
15193 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 695, __pyx_L1_error)
15194 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jacobian_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"jacobian_weak_residual", 0))) __PYX_ERR(0, 696, __pyx_L1_error)
15195 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(__pyx_self, __pyx_v_dmt, __pyx_v_w, __pyx_v_v, __pyx_v_dV, __pyx_v_jacobian_weak_residual);
15202 __Pyx_RefNannyFinishContext();
15206 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual) {
15211 double __pyx_v_dmtj_avg;
15212 double __pyx_v_vol;
15213 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
15214 __Pyx_Buffer __pyx_pybuffer_dV;
15215 __Pyx_LocalBuf_ND __pyx_pybuffernd_dmt;
15216 __Pyx_Buffer __pyx_pybuffer_dmt;
15217 __Pyx_LocalBuf_ND __pyx_pybuffernd_jacobian_weak_residual;
15218 __Pyx_Buffer __pyx_pybuffer_jacobian_weak_residual;
15219 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15220 __Pyx_Buffer __pyx_pybuffer_v;
15221 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
15222 __Pyx_Buffer __pyx_pybuffer_w;
15223 PyObject *__pyx_r = NULL;
15224 __Pyx_RefNannyDeclarations
15225 npy_intp __pyx_t_1;
15226 npy_intp __pyx_t_2;
15228 npy_intp __pyx_t_4;
15229 npy_intp __pyx_t_5;
15231 Py_ssize_t __pyx_t_7;
15232 Py_ssize_t __pyx_t_8;
15234 npy_intp __pyx_t_10;
15235 npy_intp __pyx_t_11;
15236 npy_intp __pyx_t_12;
15237 npy_intp __pyx_t_13;
15240 Py_ssize_t __pyx_t_16;
15241 Py_ssize_t __pyx_t_17;
15242 Py_ssize_t __pyx_t_18;
15243 Py_ssize_t __pyx_t_19;
15244 Py_ssize_t __pyx_t_20;
15245 Py_ssize_t __pyx_t_21;
15246 int __pyx_lineno = 0;
15247 const char *__pyx_filename = NULL;
15248 int __pyx_clineno = 0;
15249 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg", 0);
15250 __pyx_pybuffer_dmt.pybuffer.buf = NULL;
15251 __pyx_pybuffer_dmt.refcount = 0;
15252 __pyx_pybuffernd_dmt.data = NULL;
15253 __pyx_pybuffernd_dmt.rcbuffer = &__pyx_pybuffer_dmt;
15254 __pyx_pybuffer_w.pybuffer.buf = NULL;
15255 __pyx_pybuffer_w.refcount = 0;
15256 __pyx_pybuffernd_w.data = NULL;
15257 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
15258 __pyx_pybuffer_v.pybuffer.buf = NULL;
15259 __pyx_pybuffer_v.refcount = 0;
15260 __pyx_pybuffernd_v.data = NULL;
15261 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15262 __pyx_pybuffer_dV.pybuffer.buf = NULL;
15263 __pyx_pybuffer_dV.refcount = 0;
15264 __pyx_pybuffernd_dV.data = NULL;
15265 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
15266 __pyx_pybuffer_jacobian_weak_residual.pybuffer.buf = NULL;
15267 __pyx_pybuffer_jacobian_weak_residual.refcount = 0;
15268 __pyx_pybuffernd_jacobian_weak_residual.data = NULL;
15269 __pyx_pybuffernd_jacobian_weak_residual.rcbuffer = &__pyx_pybuffer_jacobian_weak_residual;
15271 __Pyx_BufFmt_StackElem __pyx_stack[1];
15272 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15274 __pyx_pybuffernd_dmt.diminfo[0].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dmt.diminfo[0].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dmt.diminfo[1].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dmt.diminfo[1].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[1];
15276 __Pyx_BufFmt_StackElem __pyx_stack[1];
15277 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15279 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
15281 __Pyx_BufFmt_StackElem __pyx_stack[1];
15282 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15284 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
15286 __Pyx_BufFmt_StackElem __pyx_stack[1];
15287 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15289 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
15291 __Pyx_BufFmt_StackElem __pyx_stack[1];
15292 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_jacobian_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15294 __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[2];
15303 __pyx_t_1 = (__pyx_v_dmt->dimensions[0]);
15304 __pyx_t_2 = __pyx_t_1;
15305 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15306 __pyx_v_eN = __pyx_t_3;
15324 __pyx_t_4 = (__pyx_v_dmt->dimensions[1]);
15325 __pyx_t_5 = __pyx_t_4;
15326 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15327 __pyx_v_k = __pyx_t_6;
15336 __pyx_t_7 = __pyx_v_eN;
15337 __pyx_t_8 = __pyx_v_k;
15339 if (__pyx_t_7 < 0) {
15340 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
15341 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
15342 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15343 if (__pyx_t_8 < 0) {
15344 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
15345 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
15346 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15347 if (unlikely(__pyx_t_9 != -1)) {
15348 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15349 __PYX_ERR(0, 705, __pyx_L1_error)
15351 __pyx_v_vol = (__pyx_v_vol + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
15361 __pyx_t_4 = (__pyx_v_w->dimensions[2]);
15362 __pyx_t_5 = __pyx_t_4;
15363 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15364 __pyx_v_i = __pyx_t_6;
15373 __pyx_t_10 = (__pyx_v_v->dimensions[2]);
15374 __pyx_t_11 = __pyx_t_10;
15375 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
15376 __pyx_v_j = __pyx_t_9;
15385 __pyx_v_dmtj_avg = 0.0;
15394 __pyx_t_12 = (__pyx_v_dmt->dimensions[1]);
15395 __pyx_t_13 = __pyx_t_12;
15396 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
15397 __pyx_v_k = __pyx_t_14;
15406 __pyx_t_8 = __pyx_v_eN;
15407 __pyx_t_7 = __pyx_v_k;
15409 if (__pyx_t_8 < 0) {
15410 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
15411 if (unlikely(__pyx_t_8 < 0)) __pyx_t_15 = 0;
15412 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_15 = 0;
15413 if (__pyx_t_7 < 0) {
15414 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
15415 if (unlikely(__pyx_t_7 < 0)) __pyx_t_15 = 1;
15416 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_15 = 1;
15417 if (unlikely(__pyx_t_15 != -1)) {
15418 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15419 __PYX_ERR(0, 710, __pyx_L1_error)
15421 __pyx_t_16 = __pyx_v_eN;
15422 __pyx_t_17 = __pyx_v_k;
15424 if (__pyx_t_16 < 0) {
15425 __pyx_t_16 += __pyx_pybuffernd_dmt.diminfo[0].shape;
15426 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
15427 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_dmt.diminfo[0].shape)) __pyx_t_15 = 0;
15428 if (__pyx_t_17 < 0) {
15429 __pyx_t_17 += __pyx_pybuffernd_dmt.diminfo[1].shape;
15430 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
15431 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dmt.diminfo[1].shape)) __pyx_t_15 = 1;
15432 if (unlikely(__pyx_t_15 != -1)) {
15433 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15434 __PYX_ERR(0, 710, __pyx_L1_error)
15436 __pyx_t_18 = __pyx_v_eN;
15437 __pyx_t_19 = __pyx_v_k;
15438 __pyx_t_20 = __pyx_v_j;
15440 if (__pyx_t_18 < 0) {
15441 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[0].shape;
15442 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 0;
15443 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
15444 if (__pyx_t_19 < 0) {
15445 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[1].shape;
15446 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 1;
15447 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
15448 if (__pyx_t_20 < 0) {
15449 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[2].shape;
15450 if (unlikely(__pyx_t_20 < 0)) __pyx_t_15 = 2;
15451 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
15452 if (unlikely(__pyx_t_15 != -1)) {
15453 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15454 __PYX_ERR(0, 710, __pyx_L1_error)
15456 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg + (((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dmt.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_dmt.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_dmt.diminfo[1].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[2].strides))));
15466 if (unlikely(__pyx_v_vol == 0)) {
15467 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
15468 __PYX_ERR(0, 711, __pyx_L1_error)
15470 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg / __pyx_v_vol);
15479 __pyx_t_20 = __pyx_v_eN;
15480 __pyx_t_19 = __pyx_v_k;
15481 __pyx_t_18 = __pyx_v_i;
15483 if (__pyx_t_20 < 0) {
15484 __pyx_t_20 += __pyx_pybuffernd_w.diminfo[0].shape;
15485 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 0;
15486 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_14 = 0;
15487 if (__pyx_t_19 < 0) {
15488 __pyx_t_19 += __pyx_pybuffernd_w.diminfo[1].shape;
15489 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 1;
15490 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_14 = 1;
15491 if (__pyx_t_18 < 0) {
15492 __pyx_t_18 += __pyx_pybuffernd_w.diminfo[2].shape;
15493 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 2;
15494 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_14 = 2;
15495 if (unlikely(__pyx_t_14 != -1)) {
15496 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15497 __PYX_ERR(0, 712, __pyx_L1_error)
15499 __pyx_t_17 = __pyx_v_eN;
15500 __pyx_t_16 = __pyx_v_k;
15502 if (__pyx_t_17 < 0) {
15503 __pyx_t_17 += __pyx_pybuffernd_dV.diminfo[0].shape;
15504 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 0;
15505 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_14 = 0;
15506 if (__pyx_t_16 < 0) {
15507 __pyx_t_16 += __pyx_pybuffernd_dV.diminfo[1].shape;
15508 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 1;
15509 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_14 = 1;
15510 if (unlikely(__pyx_t_14 != -1)) {
15511 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15512 __PYX_ERR(0, 712, __pyx_L1_error)
15514 __pyx_t_7 = __pyx_v_eN;
15515 __pyx_t_8 = __pyx_v_i;
15516 __pyx_t_21 = __pyx_v_j;
15518 if (__pyx_t_7 < 0) {
15519 __pyx_t_7 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape;
15520 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 0;
15521 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape)) __pyx_t_14 = 0;
15522 if (__pyx_t_8 < 0) {
15523 __pyx_t_8 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape;
15524 if (unlikely(__pyx_t_8 < 0)) __pyx_t_14 = 1;
15525 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape)) __pyx_t_14 = 1;
15526 if (__pyx_t_21 < 0) {
15527 __pyx_t_21 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape;
15528 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 2;
15529 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape)) __pyx_t_14 = 2;
15530 if (unlikely(__pyx_t_14 != -1)) {
15531 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15532 __PYX_ERR(0, 712, __pyx_L1_error)
15534 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides) += ((__pyx_v_dmtj_avg * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_w.diminfo[2].strides))) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_dV.diminfo[1].strides)));
15548 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15551 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15552 __Pyx_PyThreadState_declare
15553 __Pyx_PyThreadState_assign
15554 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15555 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15556 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15557 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15558 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15559 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15560 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15561 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15565 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15566 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15567 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15568 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15569 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15571 __Pyx_XGIVEREF(__pyx_r);
15572 __Pyx_RefNannyFinishContext();
15585 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15586 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux = {
"calculateNormalFlux", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux, METH_VARARGS|METH_KEYWORDS, 0};
15587 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15588 PyArrayObject *__pyx_v_v = 0;
15589 PyArrayObject *__pyx_v_n = 0;
15590 PyArrayObject *__pyx_v_dS = 0;
15591 PyArrayObject *__pyx_v_flux = 0;
15592 int __pyx_lineno = 0;
15593 const char *__pyx_filename = NULL;
15594 int __pyx_clineno = 0;
15595 PyObject *__pyx_r = 0;
15596 __Pyx_RefNannyDeclarations
15597 __Pyx_RefNannySetupContext(
"calculateNormalFlux (wrapper)", 0);
15599 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_n,&__pyx_n_s_dS,&__pyx_n_s_flux,0};
15600 PyObject* values[4] = {0,0,0,0};
15601 if (unlikely(__pyx_kwds)) {
15602 Py_ssize_t kw_args;
15603 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15604 switch (pos_args) {
15605 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15606 CYTHON_FALLTHROUGH;
15607 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15608 CYTHON_FALLTHROUGH;
15609 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15610 CYTHON_FALLTHROUGH;
15611 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15612 CYTHON_FALLTHROUGH;
15614 default:
goto __pyx_L5_argtuple_error;
15616 kw_args = PyDict_Size(__pyx_kwds);
15617 switch (pos_args) {
15619 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15620 else goto __pyx_L5_argtuple_error;
15621 CYTHON_FALLTHROUGH;
15623 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
15625 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 1); __PYX_ERR(0, 717, __pyx_L3_error)
15627 CYTHON_FALLTHROUGH;
15629 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dS)) != 0)) kw_args--;
15631 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 2); __PYX_ERR(0, 717, __pyx_L3_error)
15633 CYTHON_FALLTHROUGH;
15635 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flux)) != 0)) kw_args--;
15637 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 3); __PYX_ERR(0, 717, __pyx_L3_error)
15640 if (unlikely(kw_args > 0)) {
15641 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"calculateNormalFlux") < 0)) __PYX_ERR(0, 717, __pyx_L3_error)
15643 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
15644 goto __pyx_L5_argtuple_error;
15646 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15647 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15648 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15649 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15651 __pyx_v_v = ((PyArrayObject *)values[0]);
15652 __pyx_v_n = ((PyArrayObject *)values[1]);
15653 __pyx_v_dS = ((PyArrayObject *)values[2]);
15654 __pyx_v_flux = ((PyArrayObject *)values[3]);
15656 goto __pyx_L4_argument_unpacking_done;
15657 __pyx_L5_argtuple_error:;
15658 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 717, __pyx_L3_error)
15660 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
15661 __Pyx_RefNannyFinishContext();
15663 __pyx_L4_argument_unpacking_done:;
15664 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 717, __pyx_L1_error)
15665 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 718, __pyx_L1_error)
15666 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dS), __pyx_ptype_5numpy_ndarray, 1,
"dS", 0))) __PYX_ERR(0, 719, __pyx_L1_error)
15667 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux), __pyx_ptype_5numpy_ndarray, 1,
"flux", 0))) __PYX_ERR(0, 720, __pyx_L1_error)
15668 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(__pyx_self, __pyx_v_v, __pyx_v_n, __pyx_v_dS, __pyx_v_flux);
15675 __Pyx_RefNannyFinishContext();
15679 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux) {
15683 double __pyx_v_integral;
15684 npy_intp __pyx_v_I;
15685 __Pyx_LocalBuf_ND __pyx_pybuffernd_dS;
15686 __Pyx_Buffer __pyx_pybuffer_dS;
15687 __Pyx_LocalBuf_ND __pyx_pybuffernd_flux;
15688 __Pyx_Buffer __pyx_pybuffer_flux;
15689 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
15690 __Pyx_Buffer __pyx_pybuffer_n;
15691 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15692 __Pyx_Buffer __pyx_pybuffer_v;
15693 PyObject *__pyx_r = NULL;
15694 __Pyx_RefNannyDeclarations
15695 npy_intp __pyx_t_1;
15696 npy_intp __pyx_t_2;
15698 npy_intp __pyx_t_4;
15699 npy_intp __pyx_t_5;
15701 npy_intp __pyx_t_7;
15702 npy_intp __pyx_t_8;
15704 npy_intp __pyx_t_10;
15705 npy_intp __pyx_t_11;
15706 npy_intp __pyx_t_12;
15707 Py_ssize_t __pyx_t_13;
15708 Py_ssize_t __pyx_t_14;
15709 Py_ssize_t __pyx_t_15;
15710 Py_ssize_t __pyx_t_16;
15712 Py_ssize_t __pyx_t_18;
15713 Py_ssize_t __pyx_t_19;
15714 Py_ssize_t __pyx_t_20;
15715 Py_ssize_t __pyx_t_21;
15716 Py_ssize_t __pyx_t_22;
15717 Py_ssize_t __pyx_t_23;
15718 Py_ssize_t __pyx_t_24;
15719 int __pyx_lineno = 0;
15720 const char *__pyx_filename = NULL;
15721 int __pyx_clineno = 0;
15722 __Pyx_RefNannySetupContext(
"calculateNormalFlux", 0);
15723 __pyx_pybuffer_v.pybuffer.buf = NULL;
15724 __pyx_pybuffer_v.refcount = 0;
15725 __pyx_pybuffernd_v.data = NULL;
15726 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15727 __pyx_pybuffer_n.pybuffer.buf = NULL;
15728 __pyx_pybuffer_n.refcount = 0;
15729 __pyx_pybuffernd_n.data = NULL;
15730 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
15731 __pyx_pybuffer_dS.pybuffer.buf = NULL;
15732 __pyx_pybuffer_dS.refcount = 0;
15733 __pyx_pybuffernd_dS.data = NULL;
15734 __pyx_pybuffernd_dS.rcbuffer = &__pyx_pybuffer_dS;
15735 __pyx_pybuffer_flux.pybuffer.buf = NULL;
15736 __pyx_pybuffer_flux.refcount = 0;
15737 __pyx_pybuffernd_flux.data = NULL;
15738 __pyx_pybuffernd_flux.rcbuffer = &__pyx_pybuffer_flux;
15740 __Pyx_BufFmt_StackElem __pyx_stack[1];
15741 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15743 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
15745 __Pyx_BufFmt_StackElem __pyx_stack[1];
15746 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15748 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_n.diminfo[1].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_n.diminfo[1].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_n.diminfo[2].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_n.diminfo[2].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_n.diminfo[3].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_n.diminfo[3].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[3];
15750 __Pyx_BufFmt_StackElem __pyx_stack[1];
15751 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_v_dS, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15753 __pyx_pybuffernd_dS.diminfo[0].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dS.diminfo[0].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dS.diminfo[1].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dS.diminfo[1].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dS.diminfo[2].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dS.diminfo[2].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[2];
15755 __Pyx_BufFmt_StackElem __pyx_stack[1];
15756 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_flux.rcbuffer->pybuffer, (PyObject*)__pyx_v_flux, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15758 __pyx_pybuffernd_flux.diminfo[0].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_flux.diminfo[0].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_flux.diminfo[1].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_flux.diminfo[1].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[1];
15767 __pyx_t_1 = (__pyx_v_n->dimensions[0]);
15768 __pyx_t_2 = __pyx_t_1;
15769 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15770 __pyx_v_eN = __pyx_t_3;
15779 __pyx_t_4 = (__pyx_v_n->dimensions[1]);
15780 __pyx_t_5 = __pyx_t_4;
15781 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15782 __pyx_v_ebN = __pyx_t_6;
15791 __pyx_v_integral = 0.0;
15800 __pyx_t_7 = (__pyx_v_n->dimensions[2]);
15801 __pyx_t_8 = __pyx_t_7;
15802 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
15803 __pyx_v_kb = __pyx_t_9;
15812 __pyx_t_10 = (__pyx_v_n->dimensions[3]);
15813 __pyx_t_11 = __pyx_t_10;
15814 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
15815 __pyx_v_I = __pyx_t_12;
15824 __pyx_t_13 = __pyx_v_eN;
15825 __pyx_t_14 = __pyx_v_ebN;
15826 __pyx_t_15 = __pyx_v_kb;
15827 __pyx_t_16 = __pyx_v_I;
15829 if (__pyx_t_13 < 0) {
15830 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[0].shape;
15831 if (unlikely(__pyx_t_13 < 0)) __pyx_t_17 = 0;
15832 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_17 = 0;
15833 if (__pyx_t_14 < 0) {
15834 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[1].shape;
15835 if (unlikely(__pyx_t_14 < 0)) __pyx_t_17 = 1;
15836 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_17 = 1;
15837 if (__pyx_t_15 < 0) {
15838 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[2].shape;
15839 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 2;
15840 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_17 = 2;
15841 if (__pyx_t_16 < 0) {
15842 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
15843 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 3;
15844 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_17 = 3;
15845 if (unlikely(__pyx_t_17 != -1)) {
15846 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15847 __PYX_ERR(0, 729, __pyx_L1_error)
15849 __pyx_t_18 = __pyx_v_eN;
15850 __pyx_t_19 = __pyx_v_ebN;
15851 __pyx_t_20 = __pyx_v_kb;
15852 __pyx_t_21 = __pyx_v_I;
15854 if (__pyx_t_18 < 0) {
15855 __pyx_t_18 += __pyx_pybuffernd_n.diminfo[0].shape;
15856 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
15857 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
15858 if (__pyx_t_19 < 0) {
15859 __pyx_t_19 += __pyx_pybuffernd_n.diminfo[1].shape;
15860 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 1;
15861 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_n.diminfo[1].shape)) __pyx_t_17 = 1;
15862 if (__pyx_t_20 < 0) {
15863 __pyx_t_20 += __pyx_pybuffernd_n.diminfo[2].shape;
15864 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 2;
15865 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_n.diminfo[2].shape)) __pyx_t_17 = 2;
15866 if (__pyx_t_21 < 0) {
15867 __pyx_t_21 += __pyx_pybuffernd_n.diminfo[3].shape;
15868 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 3;
15869 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_n.diminfo[3].shape)) __pyx_t_17 = 3;
15870 if (unlikely(__pyx_t_17 != -1)) {
15871 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15872 __PYX_ERR(0, 729, __pyx_L1_error)
15874 __pyx_t_22 = __pyx_v_eN;
15875 __pyx_t_23 = __pyx_v_ebN;
15876 __pyx_t_24 = __pyx_v_kb;
15878 if (__pyx_t_22 < 0) {
15879 __pyx_t_22 += __pyx_pybuffernd_dS.diminfo[0].shape;
15880 if (unlikely(__pyx_t_22 < 0)) __pyx_t_17 = 0;
15881 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dS.diminfo[0].shape)) __pyx_t_17 = 0;
15882 if (__pyx_t_23 < 0) {
15883 __pyx_t_23 += __pyx_pybuffernd_dS.diminfo[1].shape;
15884 if (unlikely(__pyx_t_23 < 0)) __pyx_t_17 = 1;
15885 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_dS.diminfo[1].shape)) __pyx_t_17 = 1;
15886 if (__pyx_t_24 < 0) {
15887 __pyx_t_24 += __pyx_pybuffernd_dS.diminfo[2].shape;
15888 if (unlikely(__pyx_t_24 < 0)) __pyx_t_17 = 2;
15889 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_dS.diminfo[2].shape)) __pyx_t_17 = 2;
15890 if (unlikely(__pyx_t_17 != -1)) {
15891 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15892 __PYX_ERR(0, 729, __pyx_L1_error)
15894 __pyx_v_integral = (__pyx_v_integral + (((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides)) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_n.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_n.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_n.diminfo[2].strides, __pyx_t_21, __pyx_pybuffernd_n.diminfo[3].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dS.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dS.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_dS.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_dS.diminfo[2].strides))));
15905 __pyx_t_24 = __pyx_v_eN;
15906 __pyx_t_23 = __pyx_v_ebN;
15908 if (__pyx_t_24 < 0) {
15909 __pyx_t_24 += __pyx_pybuffernd_flux.diminfo[0].shape;
15910 if (unlikely(__pyx_t_24 < 0)) __pyx_t_9 = 0;
15911 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_flux.diminfo[0].shape)) __pyx_t_9 = 0;
15912 if (__pyx_t_23 < 0) {
15913 __pyx_t_23 += __pyx_pybuffernd_flux.diminfo[1].shape;
15914 if (unlikely(__pyx_t_23 < 0)) __pyx_t_9 = 1;
15915 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_flux.diminfo[1].shape)) __pyx_t_9 = 1;
15916 if (unlikely(__pyx_t_9 != -1)) {
15917 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15918 __PYX_ERR(0, 730, __pyx_L1_error)
15920 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_flux.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_flux.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_flux.diminfo[1].strides) = __pyx_v_integral;
15933 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15936 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15937 __Pyx_PyThreadState_declare
15938 __Pyx_PyThreadState_assign
15939 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15940 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
15941 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
15942 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
15943 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15944 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15945 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
15949 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
15950 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
15951 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
15952 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15954 __Pyx_XGIVEREF(__pyx_r);
15955 __Pyx_RefNannyFinishContext();
15968 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15969 static char __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
15970 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity = {
"computeSimpleCharacteristicVelocityFromElementVelocity", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity};
15971 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15972 PyArrayObject *__pyx_v_df = 0;
15973 PyArrayObject *__pyx_v_characteristic_velocity = 0;
15974 PyArrayObject *__pyx_v_dm = 0;
15975 PyArrayObject *__pyx_v_dV = 0;
15976 int __pyx_lineno = 0;
15977 const char *__pyx_filename = NULL;
15978 int __pyx_clineno = 0;
15979 PyObject *__pyx_r = 0;
15980 __Pyx_RefNannyDeclarations
15981 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity (wrapper)", 0);
15983 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_characteristic_velocity,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
15984 PyObject* values[4] = {0,0,0,0};
15985 if (unlikely(__pyx_kwds)) {
15986 Py_ssize_t kw_args;
15987 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15988 switch (pos_args) {
15989 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15990 CYTHON_FALLTHROUGH;
15991 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15992 CYTHON_FALLTHROUGH;
15993 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15994 CYTHON_FALLTHROUGH;
15995 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15996 CYTHON_FALLTHROUGH;
15998 default:
goto __pyx_L5_argtuple_error;
16000 kw_args = PyDict_Size(__pyx_kwds);
16001 switch (pos_args) {
16003 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
16004 else goto __pyx_L5_argtuple_error;
16005 CYTHON_FALLTHROUGH;
16007 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characteristic_velocity)) != 0)) kw_args--;
16009 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 1); __PYX_ERR(0, 732, __pyx_L3_error)
16011 CYTHON_FALLTHROUGH;
16013 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
16015 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 2); __PYX_ERR(0, 732, __pyx_L3_error)
16017 CYTHON_FALLTHROUGH;
16019 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
16021 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 3); __PYX_ERR(0, 732, __pyx_L3_error)
16024 if (unlikely(kw_args > 0)) {
16025 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromElementVelocity") < 0)) __PYX_ERR(0, 732, __pyx_L3_error)
16027 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
16028 goto __pyx_L5_argtuple_error;
16030 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16031 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16032 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16033 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16035 __pyx_v_df = ((PyArrayObject *)values[0]);
16036 __pyx_v_characteristic_velocity = ((PyArrayObject *)values[1]);
16037 __pyx_v_dm = ((PyArrayObject *)values[2]);
16038 __pyx_v_dV = ((PyArrayObject *)values[3]);
16040 goto __pyx_L4_argument_unpacking_done;
16041 __pyx_L5_argtuple_error:;
16042 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 732, __pyx_L3_error)
16044 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
16045 __Pyx_RefNannyFinishContext();
16047 __pyx_L4_argument_unpacking_done:;
16048 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1,
"df", 0))) __PYX_ERR(0, 732, __pyx_L1_error)
16049 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity", 0))) __PYX_ERR(0, 733, __pyx_L1_error)
16050 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 734, __pyx_L1_error)
16051 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 735, __pyx_L1_error)
16052 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(__pyx_self, __pyx_v_df, __pyx_v_characteristic_velocity, __pyx_v_dm, __pyx_v_dV);
16059 __Pyx_RefNannyFinishContext();
16063 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
16067 double __pyx_v_omega_e;
16068 double __pyx_v_vol_e;
16069 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity;
16070 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity;
16071 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
16072 __Pyx_Buffer __pyx_pybuffer_dV;
16073 __Pyx_LocalBuf_ND __pyx_pybuffernd_df;
16074 __Pyx_Buffer __pyx_pybuffer_df;
16075 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
16076 __Pyx_Buffer __pyx_pybuffer_dm;
16077 PyObject *__pyx_r = NULL;
16078 __Pyx_RefNannyDeclarations
16079 npy_intp __pyx_t_1;
16080 npy_intp __pyx_t_2;
16082 npy_intp __pyx_t_4;
16083 npy_intp __pyx_t_5;
16085 Py_ssize_t __pyx_t_7;
16086 Py_ssize_t __pyx_t_8;
16088 Py_ssize_t __pyx_t_10;
16089 Py_ssize_t __pyx_t_11;
16090 npy_intp __pyx_t_12;
16091 npy_intp __pyx_t_13;
16093 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
16095 int __pyx_lineno = 0;
16096 const char *__pyx_filename = NULL;
16097 int __pyx_clineno = 0;
16098 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity", 0);
16099 __pyx_pybuffer_df.pybuffer.buf = NULL;
16100 __pyx_pybuffer_df.refcount = 0;
16101 __pyx_pybuffernd_df.data = NULL;
16102 __pyx_pybuffernd_df.rcbuffer = &__pyx_pybuffer_df;
16103 __pyx_pybuffer_characteristic_velocity.pybuffer.buf = NULL;
16104 __pyx_pybuffer_characteristic_velocity.refcount = 0;
16105 __pyx_pybuffernd_characteristic_velocity.data = NULL;
16106 __pyx_pybuffernd_characteristic_velocity.rcbuffer = &__pyx_pybuffer_characteristic_velocity;
16107 __pyx_pybuffer_dm.pybuffer.buf = NULL;
16108 __pyx_pybuffer_dm.refcount = 0;
16109 __pyx_pybuffernd_dm.data = NULL;
16110 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
16111 __pyx_pybuffer_dV.pybuffer.buf = NULL;
16112 __pyx_pybuffer_dV.refcount = 0;
16113 __pyx_pybuffernd_dV.data = NULL;
16114 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
16116 __Pyx_BufFmt_StackElem __pyx_stack[1];
16117 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df.rcbuffer->pybuffer, (PyObject*)__pyx_v_df, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16119 __pyx_pybuffernd_df.diminfo[0].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df.diminfo[0].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_df.diminfo[1].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_df.diminfo[1].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_df.diminfo[2].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_df.diminfo[2].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[2];
16121 __Pyx_BufFmt_StackElem __pyx_stack[1];
16122 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16124 __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[2];
16126 __Pyx_BufFmt_StackElem __pyx_stack[1];
16127 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16129 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
16131 __Pyx_BufFmt_StackElem __pyx_stack[1];
16132 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16134 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
16143 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
16144 __pyx_t_2 = __pyx_t_1;
16145 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16146 __pyx_v_eN = __pyx_t_3;
16155 __pyx_v_omega_e = 0.0;
16164 __pyx_v_vol_e = 0.0;
16173 __pyx_t_4 = (__pyx_v_dm->dimensions[1]);
16174 __pyx_t_5 = __pyx_t_4;
16175 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16176 __pyx_v_k = __pyx_t_6;
16185 __pyx_t_7 = __pyx_v_eN;
16186 __pyx_t_8 = __pyx_v_k;
16188 if (__pyx_t_7 < 0) {
16189 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
16190 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
16191 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16192 if (__pyx_t_8 < 0) {
16193 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
16194 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
16195 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16196 if (unlikely(__pyx_t_9 != -1)) {
16197 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16198 __PYX_ERR(0, 747, __pyx_L1_error)
16200 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
16209 __pyx_t_8 = __pyx_v_eN;
16210 __pyx_t_7 = __pyx_v_k;
16212 if (__pyx_t_8 < 0) {
16213 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
16214 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
16215 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16216 if (__pyx_t_7 < 0) {
16217 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
16218 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
16219 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16220 if (unlikely(__pyx_t_9 != -1)) {
16221 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16222 __PYX_ERR(0, 748, __pyx_L1_error)
16224 __pyx_t_10 = __pyx_v_eN;
16225 __pyx_t_11 = __pyx_v_k;
16227 if (__pyx_t_10 < 0) {
16228 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
16229 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16230 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
16231 if (__pyx_t_11 < 0) {
16232 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
16233 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
16234 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
16235 if (unlikely(__pyx_t_9 != -1)) {
16236 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16237 __PYX_ERR(0, 748, __pyx_L1_error)
16239 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
16249 __pyx_t_4 = (__pyx_v_df->dimensions[1]);
16250 __pyx_t_5 = __pyx_t_4;
16251 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16252 __pyx_v_k = __pyx_t_6;
16261 __pyx_t_12 = (__pyx_v_df->dimensions[2]);
16262 __pyx_t_13 = __pyx_t_12;
16263 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_13; __pyx_t_9+=1) {
16264 __pyx_v_I = __pyx_t_9;
16273 __pyx_t_11 = __pyx_v_eN;
16274 __pyx_t_10 = __pyx_v_k;
16275 __pyx_t_7 = __pyx_v_I;
16277 if (__pyx_t_11 < 0) {
16278 __pyx_t_11 += __pyx_pybuffernd_df.diminfo[0].shape;
16279 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 0;
16280 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_df.diminfo[0].shape)) __pyx_t_14 = 0;
16281 if (__pyx_t_10 < 0) {
16282 __pyx_t_10 += __pyx_pybuffernd_df.diminfo[1].shape;
16283 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 1;
16284 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_df.diminfo[1].shape)) __pyx_t_14 = 1;
16285 if (__pyx_t_7 < 0) {
16286 __pyx_t_7 += __pyx_pybuffernd_df.diminfo[2].shape;
16287 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 2;
16288 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_df.diminfo[2].shape)) __pyx_t_14 = 2;
16289 if (unlikely(__pyx_t_14 != -1)) {
16290 __Pyx_RaiseBufferIndexError(__pyx_t_14);
16291 __PYX_ERR(0, 751, __pyx_L1_error)
16293 __pyx_t_15 = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_df.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_df.diminfo[1].strides, __pyx_t_7, __pyx_pybuffernd_df.diminfo[2].strides)) * __pyx_v_vol_e);
16294 __pyx_t_16 = (__pyx_v_omega_e + 1.0e-12);
16295 if (unlikely(__pyx_t_16 == 0)) {
16296 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16297 __PYX_ERR(0, 751, __pyx_L1_error)
16299 __pyx_t_7 = __pyx_v_eN;
16300 __pyx_t_10 = __pyx_v_k;
16301 __pyx_t_11 = __pyx_v_I;
16303 if (__pyx_t_7 < 0) {
16304 __pyx_t_7 += __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape;
16305 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 0;
16306 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape)) __pyx_t_14 = 0;
16307 if (__pyx_t_10 < 0) {
16308 __pyx_t_10 += __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape;
16309 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 1;
16310 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape)) __pyx_t_14 = 1;
16311 if (__pyx_t_11 < 0) {
16312 __pyx_t_11 += __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape;
16313 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 2;
16314 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape)) __pyx_t_14 = 2;
16315 if (unlikely(__pyx_t_14 != -1)) {
16316 __Pyx_RaiseBufferIndexError(__pyx_t_14);
16317 __PYX_ERR(0, 751, __pyx_L1_error)
16319 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides) = (__pyx_t_15 / __pyx_t_16);
16333 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16336 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16337 __Pyx_PyThreadState_declare
16338 __Pyx_PyThreadState_assign
16339 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16340 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
16341 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16342 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
16343 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16344 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16345 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
16349 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
16350 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16351 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
16352 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16354 __Pyx_XGIVEREF(__pyx_r);
16355 __Pyx_RefNannyFinishContext();
16368 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16369 static char __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
16370 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs = {
"computeSimpleCharacteristicVelocityFromVelocityDOFs", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs};
16371 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16372 PyArrayObject *__pyx_v_df_dofs = 0;
16373 PyArrayObject *__pyx_v_characteristic_velocity_dofs = 0;
16374 PyArrayObject *__pyx_v_l2g = 0;
16375 PyArrayObject *__pyx_v_dm = 0;
16376 PyArrayObject *__pyx_v_dV = 0;
16377 int __pyx_lineno = 0;
16378 const char *__pyx_filename = NULL;
16379 int __pyx_clineno = 0;
16380 PyObject *__pyx_r = 0;
16381 __Pyx_RefNannyDeclarations
16382 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs (wrapper)", 0);
16384 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df_dofs,&__pyx_n_s_characteristic_velocity_dofs,&__pyx_n_s_l2g,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
16385 PyObject* values[5] = {0,0,0,0,0};
16386 if (unlikely(__pyx_kwds)) {
16387 Py_ssize_t kw_args;
16388 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16389 switch (pos_args) {
16390 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16391 CYTHON_FALLTHROUGH;
16392 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16393 CYTHON_FALLTHROUGH;
16394 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16395 CYTHON_FALLTHROUGH;
16396 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16397 CYTHON_FALLTHROUGH;
16398 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16399 CYTHON_FALLTHROUGH;
16401 default:
goto __pyx_L5_argtuple_error;
16403 kw_args = PyDict_Size(__pyx_kwds);
16404 switch (pos_args) {
16406 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df_dofs)) != 0)) kw_args--;
16407 else goto __pyx_L5_argtuple_error;
16408 CYTHON_FALLTHROUGH;
16410 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characteristic_velocity_dofs)) != 0)) kw_args--;
16412 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 1); __PYX_ERR(0, 753, __pyx_L3_error)
16414 CYTHON_FALLTHROUGH;
16416 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
16418 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 2); __PYX_ERR(0, 753, __pyx_L3_error)
16420 CYTHON_FALLTHROUGH;
16422 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
16424 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 3); __PYX_ERR(0, 753, __pyx_L3_error)
16426 CYTHON_FALLTHROUGH;
16428 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
16430 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 4); __PYX_ERR(0, 753, __pyx_L3_error)
16433 if (unlikely(kw_args > 0)) {
16434 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromVelocityDOFs") < 0)) __PYX_ERR(0, 753, __pyx_L3_error)
16436 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
16437 goto __pyx_L5_argtuple_error;
16439 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16440 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16441 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16442 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16443 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16445 __pyx_v_df_dofs = ((PyArrayObject *)values[0]);
16446 __pyx_v_characteristic_velocity_dofs = ((PyArrayObject *)values[1]);
16447 __pyx_v_l2g = ((PyArrayObject *)values[2]);
16448 __pyx_v_dm = ((PyArrayObject *)values[3]);
16449 __pyx_v_dV = ((PyArrayObject *)values[4]);
16451 goto __pyx_L4_argument_unpacking_done;
16452 __pyx_L5_argtuple_error:;
16453 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 753, __pyx_L3_error)
16455 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
16456 __Pyx_RefNannyFinishContext();
16458 __pyx_L4_argument_unpacking_done:;
16459 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df_dofs), __pyx_ptype_5numpy_ndarray, 1,
"df_dofs", 0))) __PYX_ERR(0, 753, __pyx_L1_error)
16460 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity_dofs), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity_dofs", 0))) __PYX_ERR(0, 754, __pyx_L1_error)
16461 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 755, __pyx_L1_error)
16462 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 756, __pyx_L1_error)
16463 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 757, __pyx_L1_error)
16464 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(__pyx_self, __pyx_v_df_dofs, __pyx_v_characteristic_velocity_dofs, __pyx_v_l2g, __pyx_v_dm, __pyx_v_dV);
16471 __Pyx_RefNannyFinishContext();
16475 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
16480 double __pyx_v_omega_e;
16481 double __pyx_v_vol_e;
16482 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity_dofs;
16483 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity_dofs;
16484 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
16485 __Pyx_Buffer __pyx_pybuffer_dV;
16486 __Pyx_LocalBuf_ND __pyx_pybuffernd_df_dofs;
16487 __Pyx_Buffer __pyx_pybuffer_df_dofs;
16488 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
16489 __Pyx_Buffer __pyx_pybuffer_dm;
16490 __Pyx_LocalBuf_ND __pyx_pybuffernd_l2g;
16491 __Pyx_Buffer __pyx_pybuffer_l2g;
16492 PyObject *__pyx_r = NULL;
16493 __Pyx_RefNannyDeclarations
16494 npy_intp __pyx_t_1;
16495 npy_intp __pyx_t_2;
16497 npy_intp __pyx_t_4;
16498 npy_intp __pyx_t_5;
16500 Py_ssize_t __pyx_t_7;
16501 Py_ssize_t __pyx_t_8;
16503 Py_ssize_t __pyx_t_10;
16504 Py_ssize_t __pyx_t_11;
16505 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_12;
16507 int __pyx_lineno = 0;
16508 const char *__pyx_filename = NULL;
16509 int __pyx_clineno = 0;
16510 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 0);
16511 __pyx_pybuffer_df_dofs.pybuffer.buf = NULL;
16512 __pyx_pybuffer_df_dofs.refcount = 0;
16513 __pyx_pybuffernd_df_dofs.data = NULL;
16514 __pyx_pybuffernd_df_dofs.rcbuffer = &__pyx_pybuffer_df_dofs;
16515 __pyx_pybuffer_characteristic_velocity_dofs.pybuffer.buf = NULL;
16516 __pyx_pybuffer_characteristic_velocity_dofs.refcount = 0;
16517 __pyx_pybuffernd_characteristic_velocity_dofs.data = NULL;
16518 __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer = &__pyx_pybuffer_characteristic_velocity_dofs;
16519 __pyx_pybuffer_l2g.pybuffer.buf = NULL;
16520 __pyx_pybuffer_l2g.refcount = 0;
16521 __pyx_pybuffernd_l2g.data = NULL;
16522 __pyx_pybuffernd_l2g.rcbuffer = &__pyx_pybuffer_l2g;
16523 __pyx_pybuffer_dm.pybuffer.buf = NULL;
16524 __pyx_pybuffer_dm.refcount = 0;
16525 __pyx_pybuffernd_dm.data = NULL;
16526 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
16527 __pyx_pybuffer_dV.pybuffer.buf = NULL;
16528 __pyx_pybuffer_dV.refcount = 0;
16529 __pyx_pybuffernd_dV.data = NULL;
16530 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
16532 __Pyx_BufFmt_StackElem __pyx_stack[1];
16533 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_df_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16535 __pyx_pybuffernd_df_dofs.diminfo[0].strides = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df_dofs.diminfo[0].shape = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.shape[0];
16537 __Pyx_BufFmt_StackElem __pyx_stack[1];
16538 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16540 __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.shape[0];
16542 __Pyx_BufFmt_StackElem __pyx_stack[1];
16543 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16545 __pyx_pybuffernd_l2g.diminfo[0].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l2g.diminfo[0].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_l2g.diminfo[1].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_l2g.diminfo[1].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[1];
16547 __Pyx_BufFmt_StackElem __pyx_stack[1];
16548 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16550 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
16552 __Pyx_BufFmt_StackElem __pyx_stack[1];
16553 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16555 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
16564 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
16565 __pyx_t_2 = __pyx_t_1;
16566 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16567 __pyx_v_eN = __pyx_t_3;
16576 __pyx_v_omega_e = 0.0;
16585 __pyx_v_vol_e = 0.0;
16594 __pyx_t_4 = (__pyx_v_dm->dimensions[1]);
16595 __pyx_t_5 = __pyx_t_4;
16596 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16597 __pyx_v_k = __pyx_t_6;
16606 __pyx_t_7 = __pyx_v_eN;
16607 __pyx_t_8 = __pyx_v_k;
16609 if (__pyx_t_7 < 0) {
16610 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
16611 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
16612 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16613 if (__pyx_t_8 < 0) {
16614 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
16615 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
16616 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16617 if (unlikely(__pyx_t_9 != -1)) {
16618 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16619 __PYX_ERR(0, 769, __pyx_L1_error)
16621 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
16630 __pyx_t_8 = __pyx_v_eN;
16631 __pyx_t_7 = __pyx_v_k;
16633 if (__pyx_t_8 < 0) {
16634 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
16635 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
16636 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16637 if (__pyx_t_7 < 0) {
16638 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
16639 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
16640 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16641 if (unlikely(__pyx_t_9 != -1)) {
16642 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16643 __PYX_ERR(0, 770, __pyx_L1_error)
16645 __pyx_t_10 = __pyx_v_eN;
16646 __pyx_t_11 = __pyx_v_k;
16648 if (__pyx_t_10 < 0) {
16649 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
16650 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16651 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
16652 if (__pyx_t_11 < 0) {
16653 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
16654 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
16655 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
16656 if (unlikely(__pyx_t_9 != -1)) {
16657 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16658 __PYX_ERR(0, 770, __pyx_L1_error)
16660 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
16670 __pyx_t_4 = (__pyx_v_l2g->dimensions[1]);
16671 __pyx_t_5 = __pyx_t_4;
16672 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16673 __pyx_v_j = __pyx_t_6;
16682 __pyx_t_11 = __pyx_v_eN;
16683 __pyx_t_10 = __pyx_v_j;
16685 if (__pyx_t_11 < 0) {
16686 __pyx_t_11 += __pyx_pybuffernd_l2g.diminfo[0].shape;
16687 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
16688 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_l2g.diminfo[0].shape)) __pyx_t_9 = 0;
16689 if (__pyx_t_10 < 0) {
16690 __pyx_t_10 += __pyx_pybuffernd_l2g.diminfo[1].shape;
16691 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 1;
16692 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_l2g.diminfo[1].shape)) __pyx_t_9 = 1;
16693 if (unlikely(__pyx_t_9 != -1)) {
16694 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16695 __PYX_ERR(0, 772, __pyx_L1_error)
16697 __pyx_v_J = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_l2g.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_l2g.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_l2g.diminfo[1].strides));
16706 __pyx_t_10 = __pyx_v_J;
16708 if (__pyx_t_10 < 0) {
16709 __pyx_t_10 += __pyx_pybuffernd_df_dofs.diminfo[0].shape;
16710 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16711 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_df_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
16712 if (unlikely(__pyx_t_9 != -1)) {
16713 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16714 __PYX_ERR(0, 773, __pyx_L1_error)
16716 __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_df_dofs.diminfo[0].strides)) * __pyx_v_vol_e);
16717 __pyx_t_13 = (__pyx_v_omega_e + 1.0e-12);
16718 if (unlikely(__pyx_t_13 == 0)) {
16719 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16720 __PYX_ERR(0, 773, __pyx_L1_error)
16722 __pyx_t_10 = __pyx_v_J;
16724 if (__pyx_t_10 < 0) {
16725 __pyx_t_10 += __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape;
16726 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16727 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
16728 if (unlikely(__pyx_t_9 != -1)) {
16729 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16730 __PYX_ERR(0, 773, __pyx_L1_error)
16732 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides) = (__pyx_t_12 / __pyx_t_13);
16745 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16748 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16749 __Pyx_PyThreadState_declare
16750 __Pyx_PyThreadState_assign
16751 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16752 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16753 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16754 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16755 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16756 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16757 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16758 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
16762 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16763 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16764 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16765 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16766 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16768 __Pyx_XGIVEREF(__pyx_r);
16769 __Pyx_RefNannyFinishContext();
16782 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16783 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3 = {
"rotatingGaussianElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
16784 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16785 int __pyx_v_transient;
16787 double __pyx_v_tForReversal;
16788 double __pyx_v_clock;
16791 PyArrayObject *__pyx_v_x = 0;
16792 PyArrayObject *__pyx_v_v = 0;
16793 double __pyx_v_zvelocity;
16794 int __pyx_lineno = 0;
16795 const char *__pyx_filename = NULL;
16796 int __pyx_clineno = 0;
16797 PyObject *__pyx_r = 0;
16798 __Pyx_RefNannyDeclarations
16799 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3 (wrapper)", 0);
16801 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
16802 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
16803 if (unlikely(__pyx_kwds)) {
16804 Py_ssize_t kw_args;
16805 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16806 switch (pos_args) {
16807 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16808 CYTHON_FALLTHROUGH;
16809 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16810 CYTHON_FALLTHROUGH;
16811 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16812 CYTHON_FALLTHROUGH;
16813 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16814 CYTHON_FALLTHROUGH;
16815 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16816 CYTHON_FALLTHROUGH;
16817 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16818 CYTHON_FALLTHROUGH;
16819 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16820 CYTHON_FALLTHROUGH;
16821 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16822 CYTHON_FALLTHROUGH;
16823 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16824 CYTHON_FALLTHROUGH;
16826 default:
goto __pyx_L5_argtuple_error;
16828 kw_args = PyDict_Size(__pyx_kwds);
16829 switch (pos_args) {
16831 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
16832 else goto __pyx_L5_argtuple_error;
16833 CYTHON_FALLTHROUGH;
16835 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
16837 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 1); __PYX_ERR(0, 776, __pyx_L3_error)
16839 CYTHON_FALLTHROUGH;
16841 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
16843 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 2); __PYX_ERR(0, 776, __pyx_L3_error)
16845 CYTHON_FALLTHROUGH;
16847 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
16849 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 3); __PYX_ERR(0, 776, __pyx_L3_error)
16851 CYTHON_FALLTHROUGH;
16853 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
16855 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 4); __PYX_ERR(0, 776, __pyx_L3_error)
16857 CYTHON_FALLTHROUGH;
16859 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
16861 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 5); __PYX_ERR(0, 776, __pyx_L3_error)
16863 CYTHON_FALLTHROUGH;
16865 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
16867 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 6); __PYX_ERR(0, 776, __pyx_L3_error)
16869 CYTHON_FALLTHROUGH;
16871 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
16873 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 7); __PYX_ERR(0, 776, __pyx_L3_error)
16875 CYTHON_FALLTHROUGH;
16878 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zvelocity);
16879 if (value) { values[8] = value; kw_args--; }
16882 if (unlikely(kw_args > 0)) {
16883 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval3") < 0)) __PYX_ERR(0, 776, __pyx_L3_error)
16886 switch (PyTuple_GET_SIZE(__pyx_args)) {
16887 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16888 CYTHON_FALLTHROUGH;
16889 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16890 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16891 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16892 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16893 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16894 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16895 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16896 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16898 default:
goto __pyx_L5_argtuple_error;
16901 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
16902 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L3_error)
16903 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L3_error)
16904 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L3_error)
16905 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16906 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16907 __pyx_v_x = ((PyArrayObject *)values[6]);
16908 __pyx_v_v = ((PyArrayObject *)values[7]);
16910 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 783, __pyx_L3_error)
16912 __pyx_v_zvelocity = ((double)0.0);
16915 goto __pyx_L4_argument_unpacking_done;
16916 __pyx_L5_argtuple_error:;
16917 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 776, __pyx_L3_error)
16919 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
16920 __Pyx_RefNannyFinishContext();
16922 __pyx_L4_argument_unpacking_done:;
16923 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 781, __pyx_L1_error)
16924 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 782, __pyx_L1_error)
16925 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
16932 __Pyx_RefNannyFinishContext();
16936 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
16940 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
16941 __Pyx_Buffer __pyx_pybuffer_v;
16942 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
16943 __Pyx_Buffer __pyx_pybuffer_x;
16944 PyObject *__pyx_r = NULL;
16945 __Pyx_RefNannyDeclarations
16947 npy_intp __pyx_t_2;
16948 npy_intp __pyx_t_3;
16950 npy_intp __pyx_t_5;
16951 npy_intp __pyx_t_6;
16953 Py_ssize_t __pyx_t_8;
16954 Py_ssize_t __pyx_t_9;
16955 Py_ssize_t __pyx_t_10;
16957 Py_ssize_t __pyx_t_12;
16958 Py_ssize_t __pyx_t_13;
16959 Py_ssize_t __pyx_t_14;
16960 PyObject *__pyx_t_15 = NULL;
16961 PyObject *__pyx_t_16 = NULL;
16962 PyObject *__pyx_t_17 = NULL;
16965 PyObject *__pyx_t_20 = NULL;
16966 int __pyx_lineno = 0;
16967 const char *__pyx_filename = NULL;
16968 int __pyx_clineno = 0;
16969 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3", 0);
16970 __pyx_pybuffer_x.pybuffer.buf = NULL;
16971 __pyx_pybuffer_x.refcount = 0;
16972 __pyx_pybuffernd_x.data = NULL;
16973 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
16974 __pyx_pybuffer_v.pybuffer.buf = NULL;
16975 __pyx_pybuffer_v.refcount = 0;
16976 __pyx_pybuffernd_v.data = NULL;
16977 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
16979 __Pyx_BufFmt_StackElem __pyx_stack[1];
16980 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
16982 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
16984 __Pyx_BufFmt_StackElem __pyx_stack[1];
16985 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
16987 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
17005 __pyx_t_1 = (((__pyx_v_v->dimensions[2]) == 3) != 0);
17015 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17025 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17026 __pyx_t_3 = __pyx_t_2;
17027 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17028 __pyx_v_eN = __pyx_t_4;
17037 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17038 __pyx_t_6 = __pyx_t_5;
17039 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17040 __pyx_v_k = __pyx_t_7;
17049 __pyx_t_8 = __pyx_v_eN;
17050 __pyx_t_9 = __pyx_v_k;
17053 if (__pyx_t_8 < 0) {
17054 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17055 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17056 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17057 if (__pyx_t_9 < 0) {
17058 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17059 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17060 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17061 if (__pyx_t_10 < 0) {
17062 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17063 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17064 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17065 if (unlikely(__pyx_t_11 != -1)) {
17066 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17067 __PYX_ERR(0, 791, __pyx_L1_error)
17069 __pyx_t_12 = __pyx_v_eN;
17070 __pyx_t_13 = __pyx_v_k;
17073 if (__pyx_t_12 < 0) {
17074 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17075 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17076 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17077 if (__pyx_t_13 < 0) {
17078 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17079 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17080 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17081 if (__pyx_t_14 < 0) {
17082 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17083 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17084 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17085 if (unlikely(__pyx_t_11 != -1)) {
17086 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17087 __PYX_ERR(0, 791, __pyx_L1_error)
17089 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17098 __pyx_t_10 = __pyx_v_eN;
17099 __pyx_t_9 = __pyx_v_k;
17102 if (__pyx_t_10 < 0) {
17103 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17104 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17105 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17106 if (__pyx_t_9 < 0) {
17107 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17108 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17109 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17110 if (__pyx_t_8 < 0) {
17111 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17112 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17113 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17114 if (unlikely(__pyx_t_11 != -1)) {
17115 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17116 __PYX_ERR(0, 792, __pyx_L1_error)
17118 __pyx_t_14 = __pyx_v_eN;
17119 __pyx_t_13 = __pyx_v_k;
17122 if (__pyx_t_14 < 0) {
17123 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17124 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17125 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17126 if (__pyx_t_13 < 0) {
17127 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17128 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17129 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17130 if (__pyx_t_12 < 0) {
17131 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17132 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17133 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17134 if (unlikely(__pyx_t_11 != -1)) {
17135 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17136 __PYX_ERR(0, 792, __pyx_L1_error)
17138 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
17147 __pyx_t_8 = __pyx_v_eN;
17148 __pyx_t_9 = __pyx_v_k;
17151 if (__pyx_t_8 < 0) {
17152 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[0].shape;
17153 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17154 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17155 if (__pyx_t_9 < 0) {
17156 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
17157 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17158 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17159 if (__pyx_t_10 < 0) {
17160 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[2].shape;
17161 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17162 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17163 if (unlikely(__pyx_t_11 != -1)) {
17164 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17165 __PYX_ERR(0, 793, __pyx_L1_error)
17167 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
17176 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 794, __pyx_L1_error)
17177 __Pyx_GOTREF(__pyx_t_15);
17178 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 794, __pyx_L1_error)
17179 __Pyx_GOTREF(__pyx_t_16);
17180 __pyx_t_17 = PyTuple_New(3);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 794, __pyx_L1_error)
17181 __Pyx_GOTREF(__pyx_t_17);
17182 __Pyx_GIVEREF(__pyx_t_15);
17183 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15);
17184 __Pyx_GIVEREF(__pyx_t_16);
17185 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16);
17186 __Pyx_INCREF(__pyx_slice_);
17187 __Pyx_GIVEREF(__pyx_slice_);
17188 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_slice_);
17191 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 794, __pyx_L1_error)
17192 __Pyx_GOTREF(__pyx_t_16);
17193 __pyx_t_18 = (__pyx_v_tForReversal - __pyx_v_t);
17194 __pyx_t_19 = (__pyx_v_tForReversal - 0.0);
17195 if (unlikely(__pyx_t_19 == 0)) {
17196 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17197 __PYX_ERR(0, 794, __pyx_L1_error)
17199 __pyx_t_15 = PyFloat_FromDouble(((__pyx_t_18 / __pyx_t_19) * __pyx_v_clock));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 794, __pyx_L1_error)
17200 __Pyx_GOTREF(__pyx_t_15);
17201 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 794, __pyx_L1_error)
17202 __Pyx_GOTREF(__pyx_t_20);
17203 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
17204 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
17205 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_17, __pyx_t_20) < 0)) __PYX_ERR(0, 794, __pyx_L1_error)
17206 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
17207 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17229 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17230 __pyx_t_3 = __pyx_t_2;
17231 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17232 __pyx_v_eN = __pyx_t_4;
17241 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17242 __pyx_t_6 = __pyx_t_5;
17243 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17244 __pyx_v_k = __pyx_t_7;
17253 __pyx_t_10 = __pyx_v_eN;
17254 __pyx_t_9 = __pyx_v_k;
17257 if (__pyx_t_10 < 0) {
17258 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17259 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17260 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17261 if (__pyx_t_9 < 0) {
17262 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17263 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17264 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17265 if (__pyx_t_8 < 0) {
17266 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17267 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17268 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17269 if (unlikely(__pyx_t_11 != -1)) {
17270 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17271 __PYX_ERR(0, 798, __pyx_L1_error)
17273 __pyx_t_12 = __pyx_v_eN;
17274 __pyx_t_13 = __pyx_v_k;
17277 if (__pyx_t_12 < 0) {
17278 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17279 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17280 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17281 if (__pyx_t_13 < 0) {
17282 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17283 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17284 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17285 if (__pyx_t_14 < 0) {
17286 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17287 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17288 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17289 if (unlikely(__pyx_t_11 != -1)) {
17290 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17291 __PYX_ERR(0, 798, __pyx_L1_error)
17293 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17302 __pyx_t_8 = __pyx_v_eN;
17303 __pyx_t_9 = __pyx_v_k;
17306 if (__pyx_t_8 < 0) {
17307 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17308 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17309 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17310 if (__pyx_t_9 < 0) {
17311 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17312 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17313 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17314 if (__pyx_t_10 < 0) {
17315 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17316 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17317 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17318 if (unlikely(__pyx_t_11 != -1)) {
17319 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17320 __PYX_ERR(0, 799, __pyx_L1_error)
17322 __pyx_t_14 = __pyx_v_eN;
17323 __pyx_t_13 = __pyx_v_k;
17326 if (__pyx_t_14 < 0) {
17327 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17328 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17329 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17330 if (__pyx_t_13 < 0) {
17331 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17332 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17333 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17334 if (__pyx_t_12 < 0) {
17335 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17336 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17337 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17338 if (unlikely(__pyx_t_11 != -1)) {
17339 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17340 __PYX_ERR(0, 799, __pyx_L1_error)
17342 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides))));
17351 __pyx_t_10 = __pyx_v_eN;
17352 __pyx_t_9 = __pyx_v_k;
17355 if (__pyx_t_10 < 0) {
17356 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
17357 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17358 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17359 if (__pyx_t_9 < 0) {
17360 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
17361 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17362 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17363 if (__pyx_t_8 < 0) {
17364 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[2].shape;
17365 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17366 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17367 if (unlikely(__pyx_t_11 != -1)) {
17368 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17369 __PYX_ERR(0, 800, __pyx_L1_error)
17371 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
17395 #ifndef CYTHON_WITHOUT_ASSERTIONS
17396 if (unlikely(!Py_OptimizeFlag)) {
17397 if (unlikely(!(((__pyx_v_v->dimensions[2]) == 2) != 0))) {
17398 PyErr_SetNone(PyExc_AssertionError);
17399 __PYX_ERR(0, 802, __pyx_L1_error)
17411 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17421 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17422 __pyx_t_3 = __pyx_t_2;
17423 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17424 __pyx_v_eN = __pyx_t_4;
17433 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17434 __pyx_t_6 = __pyx_t_5;
17435 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17436 __pyx_v_k = __pyx_t_7;
17445 __pyx_t_8 = __pyx_v_eN;
17446 __pyx_t_9 = __pyx_v_k;
17449 if (__pyx_t_8 < 0) {
17450 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17451 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17452 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17453 if (__pyx_t_9 < 0) {
17454 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17455 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17456 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17457 if (__pyx_t_10 < 0) {
17458 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17459 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17460 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17461 if (unlikely(__pyx_t_11 != -1)) {
17462 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17463 __PYX_ERR(0, 806, __pyx_L1_error)
17465 __pyx_t_12 = __pyx_v_eN;
17466 __pyx_t_13 = __pyx_v_k;
17469 if (__pyx_t_12 < 0) {
17470 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17471 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17472 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17473 if (__pyx_t_13 < 0) {
17474 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17475 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17476 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17477 if (__pyx_t_14 < 0) {
17478 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17479 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17480 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17481 if (unlikely(__pyx_t_11 != -1)) {
17482 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17483 __PYX_ERR(0, 806, __pyx_L1_error)
17485 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17494 __pyx_t_10 = __pyx_v_eN;
17495 __pyx_t_9 = __pyx_v_k;
17498 if (__pyx_t_10 < 0) {
17499 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17500 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17501 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17502 if (__pyx_t_9 < 0) {
17503 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17504 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17505 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17506 if (__pyx_t_8 < 0) {
17507 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17508 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17509 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17510 if (unlikely(__pyx_t_11 != -1)) {
17511 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17512 __PYX_ERR(0, 807, __pyx_L1_error)
17514 __pyx_t_14 = __pyx_v_eN;
17515 __pyx_t_13 = __pyx_v_k;
17518 if (__pyx_t_14 < 0) {
17519 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17520 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17521 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17522 if (__pyx_t_13 < 0) {
17523 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17524 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17525 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17526 if (__pyx_t_12 < 0) {
17527 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17528 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17529 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17530 if (unlikely(__pyx_t_11 != -1)) {
17531 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17532 __PYX_ERR(0, 807, __pyx_L1_error)
17534 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
17543 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 808, __pyx_L1_error)
17544 __Pyx_GOTREF(__pyx_t_17);
17545 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 808, __pyx_L1_error)
17546 __Pyx_GOTREF(__pyx_t_20);
17547 __pyx_t_15 = PyTuple_New(3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 808, __pyx_L1_error)
17548 __Pyx_GOTREF(__pyx_t_15);
17549 __Pyx_GIVEREF(__pyx_t_17);
17550 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_17);
17551 __Pyx_GIVEREF(__pyx_t_20);
17552 PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_20);
17553 __Pyx_INCREF(__pyx_slice_);
17554 __Pyx_GIVEREF(__pyx_slice_);
17555 PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_slice_);
17558 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_15);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 808, __pyx_L1_error)
17559 __Pyx_GOTREF(__pyx_t_20);
17560 __pyx_t_19 = (__pyx_v_tForReversal - __pyx_v_t);
17561 __pyx_t_18 = (__pyx_v_tForReversal - 0.0);
17562 if (unlikely(__pyx_t_18 == 0)) {
17563 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17564 __PYX_ERR(0, 808, __pyx_L1_error)
17566 __pyx_t_17 = PyFloat_FromDouble(((__pyx_t_19 / __pyx_t_18) * __pyx_v_clock));
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 808, __pyx_L1_error)
17567 __Pyx_GOTREF(__pyx_t_17);
17568 __pyx_t_16 = PyNumber_InPlaceMultiply(__pyx_t_20, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 808, __pyx_L1_error)
17569 __Pyx_GOTREF(__pyx_t_16);
17570 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
17571 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17572 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_15, __pyx_t_16) < 0)) __PYX_ERR(0, 808, __pyx_L1_error)
17573 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
17574 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
17596 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17597 __pyx_t_3 = __pyx_t_2;
17598 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17599 __pyx_v_eN = __pyx_t_4;
17608 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17609 __pyx_t_6 = __pyx_t_5;
17610 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17611 __pyx_v_k = __pyx_t_7;
17620 __pyx_t_8 = __pyx_v_eN;
17621 __pyx_t_9 = __pyx_v_k;
17624 if (__pyx_t_8 < 0) {
17625 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17626 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17627 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17628 if (__pyx_t_9 < 0) {
17629 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17630 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17631 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17632 if (__pyx_t_10 < 0) {
17633 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17634 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17635 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17636 if (unlikely(__pyx_t_11 != -1)) {
17637 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17638 __PYX_ERR(0, 812, __pyx_L1_error)
17640 __pyx_t_12 = __pyx_v_eN;
17641 __pyx_t_13 = __pyx_v_k;
17644 if (__pyx_t_12 < 0) {
17645 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17646 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17647 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17648 if (__pyx_t_13 < 0) {
17649 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17650 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17651 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17652 if (__pyx_t_14 < 0) {
17653 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17654 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17655 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17656 if (unlikely(__pyx_t_11 != -1)) {
17657 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17658 __PYX_ERR(0, 812, __pyx_L1_error)
17660 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17669 __pyx_t_10 = __pyx_v_eN;
17670 __pyx_t_9 = __pyx_v_k;
17673 if (__pyx_t_10 < 0) {
17674 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17675 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17676 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17677 if (__pyx_t_9 < 0) {
17678 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17679 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17680 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17681 if (__pyx_t_8 < 0) {
17682 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17683 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17684 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17685 if (unlikely(__pyx_t_11 != -1)) {
17686 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17687 __PYX_ERR(0, 813, __pyx_L1_error)
17689 __pyx_t_14 = __pyx_v_eN;
17690 __pyx_t_13 = __pyx_v_k;
17693 if (__pyx_t_14 < 0) {
17694 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17695 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17696 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17697 if (__pyx_t_13 < 0) {
17698 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17699 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17700 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17701 if (__pyx_t_12 < 0) {
17702 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17703 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17704 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17705 if (unlikely(__pyx_t_11 != -1)) {
17706 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17707 __PYX_ERR(0, 813, __pyx_L1_error)
17709 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
17726 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17729 __Pyx_XDECREF(__pyx_t_15);
17730 __Pyx_XDECREF(__pyx_t_16);
17731 __Pyx_XDECREF(__pyx_t_17);
17732 __Pyx_XDECREF(__pyx_t_20);
17733 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
17734 __Pyx_PyThreadState_declare
17735 __Pyx_PyThreadState_assign
17736 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
17737 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17738 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17739 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
17740 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17744 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17745 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17747 __Pyx_XGIVEREF(__pyx_r);
17748 __Pyx_RefNannyFinishContext();
17761 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17762 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4 = {
"rotatingGaussianElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
17763 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17764 int __pyx_v_transient;
17766 double __pyx_v_tForReversal;
17767 double __pyx_v_clock;
17770 PyArrayObject *__pyx_v_x = 0;
17771 PyArrayObject *__pyx_v_v = 0;
17772 double __pyx_v_zvelocity;
17773 int __pyx_lineno = 0;
17774 const char *__pyx_filename = NULL;
17775 int __pyx_clineno = 0;
17776 PyObject *__pyx_r = 0;
17777 __Pyx_RefNannyDeclarations
17778 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4 (wrapper)", 0);
17780 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
17781 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
17782 if (unlikely(__pyx_kwds)) {
17783 Py_ssize_t kw_args;
17784 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17785 switch (pos_args) {
17786 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17787 CYTHON_FALLTHROUGH;
17788 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17789 CYTHON_FALLTHROUGH;
17790 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17791 CYTHON_FALLTHROUGH;
17792 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17793 CYTHON_FALLTHROUGH;
17794 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17795 CYTHON_FALLTHROUGH;
17796 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17797 CYTHON_FALLTHROUGH;
17798 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17799 CYTHON_FALLTHROUGH;
17800 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17801 CYTHON_FALLTHROUGH;
17802 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17803 CYTHON_FALLTHROUGH;
17805 default:
goto __pyx_L5_argtuple_error;
17807 kw_args = PyDict_Size(__pyx_kwds);
17808 switch (pos_args) {
17810 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
17811 else goto __pyx_L5_argtuple_error;
17812 CYTHON_FALLTHROUGH;
17814 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
17816 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 1); __PYX_ERR(0, 816, __pyx_L3_error)
17818 CYTHON_FALLTHROUGH;
17820 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
17822 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 2); __PYX_ERR(0, 816, __pyx_L3_error)
17824 CYTHON_FALLTHROUGH;
17826 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
17828 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 3); __PYX_ERR(0, 816, __pyx_L3_error)
17830 CYTHON_FALLTHROUGH;
17832 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
17834 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 4); __PYX_ERR(0, 816, __pyx_L3_error)
17836 CYTHON_FALLTHROUGH;
17838 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
17840 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 5); __PYX_ERR(0, 816, __pyx_L3_error)
17842 CYTHON_FALLTHROUGH;
17844 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
17846 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 6); __PYX_ERR(0, 816, __pyx_L3_error)
17848 CYTHON_FALLTHROUGH;
17850 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
17852 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 7); __PYX_ERR(0, 816, __pyx_L3_error)
17854 CYTHON_FALLTHROUGH;
17857 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zvelocity);
17858 if (value) { values[8] = value; kw_args--; }
17861 if (unlikely(kw_args > 0)) {
17862 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval4") < 0)) __PYX_ERR(0, 816, __pyx_L3_error)
17865 switch (PyTuple_GET_SIZE(__pyx_args)) {
17866 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17867 CYTHON_FALLTHROUGH;
17868 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17869 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17870 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17871 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17872 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17873 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17874 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17875 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17877 default:
goto __pyx_L5_argtuple_error;
17880 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L3_error)
17881 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L3_error)
17882 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error)
17883 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 819, __pyx_L3_error)
17884 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
17885 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
17886 __pyx_v_x = ((PyArrayObject *)values[6]);
17887 __pyx_v_v = ((PyArrayObject *)values[7]);
17889 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L3_error)
17891 __pyx_v_zvelocity = ((double)0.0);
17894 goto __pyx_L4_argument_unpacking_done;
17895 __pyx_L5_argtuple_error:;
17896 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 816, __pyx_L3_error)
17898 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
17899 __Pyx_RefNannyFinishContext();
17901 __pyx_L4_argument_unpacking_done:;
17902 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 821, __pyx_L1_error)
17903 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 822, __pyx_L1_error)
17904 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
17911 __Pyx_RefNannyFinishContext();
17915 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
17920 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
17921 __Pyx_Buffer __pyx_pybuffer_v;
17922 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
17923 __Pyx_Buffer __pyx_pybuffer_x;
17924 PyObject *__pyx_r = NULL;
17925 __Pyx_RefNannyDeclarations
17927 npy_intp __pyx_t_2;
17928 npy_intp __pyx_t_3;
17930 npy_intp __pyx_t_5;
17931 npy_intp __pyx_t_6;
17933 npy_intp __pyx_t_8;
17934 npy_intp __pyx_t_9;
17936 Py_ssize_t __pyx_t_11;
17937 Py_ssize_t __pyx_t_12;
17938 Py_ssize_t __pyx_t_13;
17939 Py_ssize_t __pyx_t_14;
17941 Py_ssize_t __pyx_t_16;
17942 Py_ssize_t __pyx_t_17;
17943 Py_ssize_t __pyx_t_18;
17944 Py_ssize_t __pyx_t_19;
17945 PyObject *__pyx_t_20 = NULL;
17946 PyObject *__pyx_t_21 = NULL;
17947 PyObject *__pyx_t_22 = NULL;
17948 PyObject *__pyx_t_23 = NULL;
17951 int __pyx_lineno = 0;
17952 const char *__pyx_filename = NULL;
17953 int __pyx_clineno = 0;
17954 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4", 0);
17955 __pyx_pybuffer_x.pybuffer.buf = NULL;
17956 __pyx_pybuffer_x.refcount = 0;
17957 __pyx_pybuffernd_x.data = NULL;
17958 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
17959 __pyx_pybuffer_v.pybuffer.buf = NULL;
17960 __pyx_pybuffer_v.refcount = 0;
17961 __pyx_pybuffernd_v.data = NULL;
17962 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
17964 __Pyx_BufFmt_StackElem __pyx_stack[1];
17965 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
17967 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
17969 __Pyx_BufFmt_StackElem __pyx_stack[1];
17970 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
17972 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
17990 __pyx_t_1 = (((__pyx_v_v->dimensions[(__pyx_v_v->nd - 1)]) == 3) != 0);
18000 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18010 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18011 __pyx_t_3 = __pyx_t_2;
18012 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18013 __pyx_v_eN = __pyx_t_4;
18022 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18023 __pyx_t_6 = __pyx_t_5;
18024 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18025 __pyx_v_ebN = __pyx_t_7;
18034 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18035 __pyx_t_9 = __pyx_t_8;
18036 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18037 __pyx_v_k = __pyx_t_10;
18046 __pyx_t_11 = __pyx_v_eN;
18047 __pyx_t_12 = __pyx_v_ebN;
18048 __pyx_t_13 = __pyx_v_k;
18051 if (__pyx_t_11 < 0) {
18052 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18053 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18054 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18055 if (__pyx_t_12 < 0) {
18056 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18057 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18058 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18059 if (__pyx_t_13 < 0) {
18060 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18061 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18062 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18063 if (__pyx_t_14 < 0) {
18064 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18065 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18066 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18067 if (unlikely(__pyx_t_15 != -1)) {
18068 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18069 __PYX_ERR(0, 832, __pyx_L1_error)
18071 __pyx_t_16 = __pyx_v_eN;
18072 __pyx_t_17 = __pyx_v_ebN;
18073 __pyx_t_18 = __pyx_v_k;
18076 if (__pyx_t_16 < 0) {
18077 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18078 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18079 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18080 if (__pyx_t_17 < 0) {
18081 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18082 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18083 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18084 if (__pyx_t_18 < 0) {
18085 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18086 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18087 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18088 if (__pyx_t_19 < 0) {
18089 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18090 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18091 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18092 if (unlikely(__pyx_t_15 != -1)) {
18093 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18094 __PYX_ERR(0, 832, __pyx_L1_error)
18096 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18105 __pyx_t_14 = __pyx_v_eN;
18106 __pyx_t_13 = __pyx_v_ebN;
18107 __pyx_t_12 = __pyx_v_k;
18110 if (__pyx_t_14 < 0) {
18111 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18112 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18113 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18114 if (__pyx_t_13 < 0) {
18115 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18116 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18117 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18118 if (__pyx_t_12 < 0) {
18119 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18120 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18121 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18122 if (__pyx_t_11 < 0) {
18123 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18124 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18125 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18126 if (unlikely(__pyx_t_15 != -1)) {
18127 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18128 __PYX_ERR(0, 833, __pyx_L1_error)
18130 __pyx_t_19 = __pyx_v_eN;
18131 __pyx_t_18 = __pyx_v_ebN;
18132 __pyx_t_17 = __pyx_v_k;
18135 if (__pyx_t_19 < 0) {
18136 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18137 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18138 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18139 if (__pyx_t_18 < 0) {
18140 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18141 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18142 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18143 if (__pyx_t_17 < 0) {
18144 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18145 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18146 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18147 if (__pyx_t_16 < 0) {
18148 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18149 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18150 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18151 if (unlikely(__pyx_t_15 != -1)) {
18152 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18153 __PYX_ERR(0, 833, __pyx_L1_error)
18155 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
18164 __pyx_t_11 = __pyx_v_eN;
18165 __pyx_t_12 = __pyx_v_ebN;
18166 __pyx_t_13 = __pyx_v_k;
18169 if (__pyx_t_11 < 0) {
18170 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[0].shape;
18171 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18172 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18173 if (__pyx_t_12 < 0) {
18174 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[1].shape;
18175 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18176 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18177 if (__pyx_t_13 < 0) {
18178 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[2].shape;
18179 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18180 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18181 if (__pyx_t_14 < 0) {
18182 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[3].shape;
18183 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18184 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18185 if (unlikely(__pyx_t_15 != -1)) {
18186 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18187 __PYX_ERR(0, 834, __pyx_L1_error)
18189 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
18198 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 835, __pyx_L1_error)
18199 __Pyx_GOTREF(__pyx_t_20);
18200 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 835, __pyx_L1_error)
18201 __Pyx_GOTREF(__pyx_t_21);
18202 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 835, __pyx_L1_error)
18203 __Pyx_GOTREF(__pyx_t_22);
18204 __pyx_t_23 = PyTuple_New(4);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 835, __pyx_L1_error)
18205 __Pyx_GOTREF(__pyx_t_23);
18206 __Pyx_GIVEREF(__pyx_t_20);
18207 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20);
18208 __Pyx_GIVEREF(__pyx_t_21);
18209 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21);
18210 __Pyx_GIVEREF(__pyx_t_22);
18211 PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_22);
18212 __Pyx_INCREF(__pyx_slice_);
18213 __Pyx_GIVEREF(__pyx_slice_);
18214 PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_slice_);
18218 __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_23);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 835, __pyx_L1_error)
18219 __Pyx_GOTREF(__pyx_t_22);
18220 __pyx_t_24 = (__pyx_v_tForReversal - __pyx_v_t);
18221 __pyx_t_25 = (__pyx_v_tForReversal - 0.0);
18222 if (unlikely(__pyx_t_25 == 0)) {
18223 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18224 __PYX_ERR(0, 835, __pyx_L1_error)
18226 __pyx_t_21 = PyFloat_FromDouble(((__pyx_t_24 / __pyx_t_25) * __pyx_v_clock));
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 835, __pyx_L1_error)
18227 __Pyx_GOTREF(__pyx_t_21);
18228 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_22, __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 835, __pyx_L1_error)
18229 __Pyx_GOTREF(__pyx_t_20);
18230 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
18231 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
18232 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_23, __pyx_t_20) < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
18233 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
18234 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
18257 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18258 __pyx_t_3 = __pyx_t_2;
18259 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18260 __pyx_v_eN = __pyx_t_4;
18269 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18270 __pyx_t_6 = __pyx_t_5;
18271 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18272 __pyx_v_ebN = __pyx_t_7;
18281 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18282 __pyx_t_9 = __pyx_t_8;
18283 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18284 __pyx_v_k = __pyx_t_10;
18293 __pyx_t_14 = __pyx_v_eN;
18294 __pyx_t_13 = __pyx_v_ebN;
18295 __pyx_t_12 = __pyx_v_k;
18298 if (__pyx_t_14 < 0) {
18299 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18300 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18301 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18302 if (__pyx_t_13 < 0) {
18303 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18304 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18305 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18306 if (__pyx_t_12 < 0) {
18307 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18308 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18309 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18310 if (__pyx_t_11 < 0) {
18311 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18312 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18313 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18314 if (unlikely(__pyx_t_15 != -1)) {
18315 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18316 __PYX_ERR(0, 840, __pyx_L1_error)
18318 __pyx_t_16 = __pyx_v_eN;
18319 __pyx_t_17 = __pyx_v_ebN;
18320 __pyx_t_18 = __pyx_v_k;
18323 if (__pyx_t_16 < 0) {
18324 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18325 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18326 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18327 if (__pyx_t_17 < 0) {
18328 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18329 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18330 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18331 if (__pyx_t_18 < 0) {
18332 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18333 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18334 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18335 if (__pyx_t_19 < 0) {
18336 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18337 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18338 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18339 if (unlikely(__pyx_t_15 != -1)) {
18340 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18341 __PYX_ERR(0, 840, __pyx_L1_error)
18343 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18352 __pyx_t_11 = __pyx_v_eN;
18353 __pyx_t_12 = __pyx_v_ebN;
18354 __pyx_t_13 = __pyx_v_k;
18357 if (__pyx_t_11 < 0) {
18358 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18359 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18360 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18361 if (__pyx_t_12 < 0) {
18362 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18363 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18364 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18365 if (__pyx_t_13 < 0) {
18366 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18367 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18368 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18369 if (__pyx_t_14 < 0) {
18370 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18371 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18372 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18373 if (unlikely(__pyx_t_15 != -1)) {
18374 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18375 __PYX_ERR(0, 841, __pyx_L1_error)
18377 __pyx_t_19 = __pyx_v_eN;
18378 __pyx_t_18 = __pyx_v_ebN;
18379 __pyx_t_17 = __pyx_v_k;
18382 if (__pyx_t_19 < 0) {
18383 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18384 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18385 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18386 if (__pyx_t_18 < 0) {
18387 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18388 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18389 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18390 if (__pyx_t_17 < 0) {
18391 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18392 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18393 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18394 if (__pyx_t_16 < 0) {
18395 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18396 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18397 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18398 if (unlikely(__pyx_t_15 != -1)) {
18399 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18400 __PYX_ERR(0, 841, __pyx_L1_error)
18402 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides))));
18411 __pyx_t_14 = __pyx_v_eN;
18412 __pyx_t_13 = __pyx_v_ebN;
18413 __pyx_t_12 = __pyx_v_k;
18416 if (__pyx_t_14 < 0) {
18417 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
18418 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18419 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18420 if (__pyx_t_13 < 0) {
18421 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
18422 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18423 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18424 if (__pyx_t_12 < 0) {
18425 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
18426 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18427 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18428 if (__pyx_t_11 < 0) {
18429 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[3].shape;
18430 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18431 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18432 if (unlikely(__pyx_t_15 != -1)) {
18433 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18434 __PYX_ERR(0, 842, __pyx_L1_error)
18436 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
18461 #ifndef CYTHON_WITHOUT_ASSERTIONS
18462 if (unlikely(!Py_OptimizeFlag)) {
18463 if (unlikely(!(((__pyx_v_v->dimensions[(__pyx_v_v->nd - 1)]) == 2) != 0))) {
18464 PyErr_SetNone(PyExc_AssertionError);
18465 __PYX_ERR(0, 844, __pyx_L1_error)
18477 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18487 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18488 __pyx_t_3 = __pyx_t_2;
18489 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18490 __pyx_v_eN = __pyx_t_4;
18499 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18500 __pyx_t_6 = __pyx_t_5;
18501 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18502 __pyx_v_ebN = __pyx_t_7;
18511 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18512 __pyx_t_9 = __pyx_t_8;
18513 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18514 __pyx_v_k = __pyx_t_10;
18523 __pyx_t_11 = __pyx_v_eN;
18524 __pyx_t_12 = __pyx_v_ebN;
18525 __pyx_t_13 = __pyx_v_k;
18528 if (__pyx_t_11 < 0) {
18529 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18530 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18531 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18532 if (__pyx_t_12 < 0) {
18533 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18534 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18535 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18536 if (__pyx_t_13 < 0) {
18537 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18538 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18539 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18540 if (__pyx_t_14 < 0) {
18541 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18542 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18543 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18544 if (unlikely(__pyx_t_15 != -1)) {
18545 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18546 __PYX_ERR(0, 849, __pyx_L1_error)
18548 __pyx_t_16 = __pyx_v_eN;
18549 __pyx_t_17 = __pyx_v_ebN;
18550 __pyx_t_18 = __pyx_v_k;
18553 if (__pyx_t_16 < 0) {
18554 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18555 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18556 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18557 if (__pyx_t_17 < 0) {
18558 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18559 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18560 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18561 if (__pyx_t_18 < 0) {
18562 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18563 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18564 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18565 if (__pyx_t_19 < 0) {
18566 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18567 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18568 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18569 if (unlikely(__pyx_t_15 != -1)) {
18570 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18571 __PYX_ERR(0, 849, __pyx_L1_error)
18573 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18582 __pyx_t_14 = __pyx_v_eN;
18583 __pyx_t_13 = __pyx_v_ebN;
18584 __pyx_t_12 = __pyx_v_k;
18587 if (__pyx_t_14 < 0) {
18588 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18589 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18590 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18591 if (__pyx_t_13 < 0) {
18592 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18593 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18594 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18595 if (__pyx_t_12 < 0) {
18596 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18597 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18598 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18599 if (__pyx_t_11 < 0) {
18600 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18601 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18602 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18603 if (unlikely(__pyx_t_15 != -1)) {
18604 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18605 __PYX_ERR(0, 850, __pyx_L1_error)
18607 __pyx_t_19 = __pyx_v_eN;
18608 __pyx_t_18 = __pyx_v_ebN;
18609 __pyx_t_17 = __pyx_v_k;
18612 if (__pyx_t_19 < 0) {
18613 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18614 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18615 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18616 if (__pyx_t_18 < 0) {
18617 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18618 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18619 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18620 if (__pyx_t_17 < 0) {
18621 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18622 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18623 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18624 if (__pyx_t_16 < 0) {
18625 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18626 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18627 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18628 if (unlikely(__pyx_t_15 != -1)) {
18629 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18630 __PYX_ERR(0, 850, __pyx_L1_error)
18632 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
18641 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 851, __pyx_L1_error)
18642 __Pyx_GOTREF(__pyx_t_23);
18643 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 851, __pyx_L1_error)
18644 __Pyx_GOTREF(__pyx_t_20);
18645 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 851, __pyx_L1_error)
18646 __Pyx_GOTREF(__pyx_t_21);
18647 __pyx_t_22 = PyTuple_New(4);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 851, __pyx_L1_error)
18648 __Pyx_GOTREF(__pyx_t_22);
18649 __Pyx_GIVEREF(__pyx_t_23);
18650 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_23);
18651 __Pyx_GIVEREF(__pyx_t_20);
18652 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_20);
18653 __Pyx_GIVEREF(__pyx_t_21);
18654 PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_21);
18655 __Pyx_INCREF(__pyx_slice_);
18656 __Pyx_GIVEREF(__pyx_slice_);
18657 PyTuple_SET_ITEM(__pyx_t_22, 3, __pyx_slice_);
18661 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_22);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 851, __pyx_L1_error)
18662 __Pyx_GOTREF(__pyx_t_21);
18663 __pyx_t_25 = (__pyx_v_tForReversal - __pyx_v_t);
18664 __pyx_t_24 = (__pyx_v_tForReversal - 0.0);
18665 if (unlikely(__pyx_t_24 == 0)) {
18666 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18667 __PYX_ERR(0, 851, __pyx_L1_error)
18669 __pyx_t_20 = PyFloat_FromDouble(((__pyx_t_25 / __pyx_t_24) * __pyx_v_clock));
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 851, __pyx_L1_error)
18670 __Pyx_GOTREF(__pyx_t_20);
18671 __pyx_t_23 = PyNumber_InPlaceMultiply(__pyx_t_21, __pyx_t_20);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 851, __pyx_L1_error)
18672 __Pyx_GOTREF(__pyx_t_23);
18673 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
18674 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
18675 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_22, __pyx_t_23) < 0)) __PYX_ERR(0, 851, __pyx_L1_error)
18676 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
18677 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
18700 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18701 __pyx_t_3 = __pyx_t_2;
18702 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18703 __pyx_v_eN = __pyx_t_4;
18712 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18713 __pyx_t_6 = __pyx_t_5;
18714 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18715 __pyx_v_ebN = __pyx_t_7;
18724 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18725 __pyx_t_9 = __pyx_t_8;
18726 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18727 __pyx_v_k = __pyx_t_10;
18736 __pyx_t_11 = __pyx_v_eN;
18737 __pyx_t_12 = __pyx_v_ebN;
18738 __pyx_t_13 = __pyx_v_k;
18741 if (__pyx_t_11 < 0) {
18742 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18743 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18744 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18745 if (__pyx_t_12 < 0) {
18746 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18747 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18748 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18749 if (__pyx_t_13 < 0) {
18750 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18751 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18752 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18753 if (__pyx_t_14 < 0) {
18754 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18755 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18756 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18757 if (unlikely(__pyx_t_15 != -1)) {
18758 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18759 __PYX_ERR(0, 856, __pyx_L1_error)
18761 __pyx_t_16 = __pyx_v_eN;
18762 __pyx_t_17 = __pyx_v_ebN;
18763 __pyx_t_18 = __pyx_v_k;
18766 if (__pyx_t_16 < 0) {
18767 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18768 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18769 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18770 if (__pyx_t_17 < 0) {
18771 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18772 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18773 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18774 if (__pyx_t_18 < 0) {
18775 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18776 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18777 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18778 if (__pyx_t_19 < 0) {
18779 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18780 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18781 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18782 if (unlikely(__pyx_t_15 != -1)) {
18783 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18784 __PYX_ERR(0, 856, __pyx_L1_error)
18786 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18795 __pyx_t_14 = __pyx_v_eN;
18796 __pyx_t_13 = __pyx_v_ebN;
18797 __pyx_t_12 = __pyx_v_k;
18800 if (__pyx_t_14 < 0) {
18801 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18802 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18803 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18804 if (__pyx_t_13 < 0) {
18805 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18806 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18807 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18808 if (__pyx_t_12 < 0) {
18809 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18810 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18811 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18812 if (__pyx_t_11 < 0) {
18813 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18814 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18815 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18816 if (unlikely(__pyx_t_15 != -1)) {
18817 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18818 __PYX_ERR(0, 857, __pyx_L1_error)
18820 __pyx_t_19 = __pyx_v_eN;
18821 __pyx_t_18 = __pyx_v_ebN;
18822 __pyx_t_17 = __pyx_v_k;
18825 if (__pyx_t_19 < 0) {
18826 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18827 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18828 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18829 if (__pyx_t_18 < 0) {
18830 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18831 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18832 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18833 if (__pyx_t_17 < 0) {
18834 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18835 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18836 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18837 if (__pyx_t_16 < 0) {
18838 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18839 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18840 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18841 if (unlikely(__pyx_t_15 != -1)) {
18842 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18843 __PYX_ERR(0, 857, __pyx_L1_error)
18845 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
18863 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18866 __Pyx_XDECREF(__pyx_t_20);
18867 __Pyx_XDECREF(__pyx_t_21);
18868 __Pyx_XDECREF(__pyx_t_22);
18869 __Pyx_XDECREF(__pyx_t_23);
18870 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
18871 __Pyx_PyThreadState_declare
18872 __Pyx_PyThreadState_assign
18873 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
18874 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18875 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18876 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
18877 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
18881 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18882 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18884 __Pyx_XGIVEREF(__pyx_r);
18885 __Pyx_RefNannyFinishContext();
18898 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18899 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3 = {
"helicalElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
18900 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18901 int __pyx_v_transient;
18903 double __pyx_v_tForReversal;
18904 double __pyx_v_clock;
18905 double __pyx_v_zVelocity;
18908 PyArrayObject *__pyx_v_x = 0;
18909 PyArrayObject *__pyx_v_v = 0;
18910 int __pyx_lineno = 0;
18911 const char *__pyx_filename = NULL;
18912 int __pyx_clineno = 0;
18913 PyObject *__pyx_r = 0;
18914 __Pyx_RefNannyDeclarations
18915 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3 (wrapper)", 0);
18917 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
18918 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
18919 if (unlikely(__pyx_kwds)) {
18920 Py_ssize_t kw_args;
18921 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18922 switch (pos_args) {
18923 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
18924 CYTHON_FALLTHROUGH;
18925 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
18926 CYTHON_FALLTHROUGH;
18927 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
18928 CYTHON_FALLTHROUGH;
18929 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
18930 CYTHON_FALLTHROUGH;
18931 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18932 CYTHON_FALLTHROUGH;
18933 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18934 CYTHON_FALLTHROUGH;
18935 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18936 CYTHON_FALLTHROUGH;
18937 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18938 CYTHON_FALLTHROUGH;
18939 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18940 CYTHON_FALLTHROUGH;
18942 default:
goto __pyx_L5_argtuple_error;
18944 kw_args = PyDict_Size(__pyx_kwds);
18945 switch (pos_args) {
18947 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
18948 else goto __pyx_L5_argtuple_error;
18949 CYTHON_FALLTHROUGH;
18951 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
18953 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 1); __PYX_ERR(0, 859, __pyx_L3_error)
18955 CYTHON_FALLTHROUGH;
18957 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
18959 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 2); __PYX_ERR(0, 859, __pyx_L3_error)
18961 CYTHON_FALLTHROUGH;
18963 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
18965 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 3); __PYX_ERR(0, 859, __pyx_L3_error)
18967 CYTHON_FALLTHROUGH;
18969 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
18971 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 4); __PYX_ERR(0, 859, __pyx_L3_error)
18973 CYTHON_FALLTHROUGH;
18975 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
18977 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 5); __PYX_ERR(0, 859, __pyx_L3_error)
18979 CYTHON_FALLTHROUGH;
18981 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
18983 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 6); __PYX_ERR(0, 859, __pyx_L3_error)
18985 CYTHON_FALLTHROUGH;
18987 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
18989 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 7); __PYX_ERR(0, 859, __pyx_L3_error)
18991 CYTHON_FALLTHROUGH;
18993 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
18995 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 8); __PYX_ERR(0, 859, __pyx_L3_error)
18998 if (unlikely(kw_args > 0)) {
18999 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval3") < 0)) __PYX_ERR(0, 859, __pyx_L3_error)
19001 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
19002 goto __pyx_L5_argtuple_error;
19004 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19005 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19006 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19007 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19008 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19009 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19010 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19011 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19012 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19014 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 859, __pyx_L3_error)
19015 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 860, __pyx_L3_error)
19016 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L3_error)
19017 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 862, __pyx_L3_error)
19018 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L3_error)
19019 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
19020 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
19021 __pyx_v_x = ((PyArrayObject *)values[7]);
19022 __pyx_v_v = ((PyArrayObject *)values[8]);
19024 goto __pyx_L4_argument_unpacking_done;
19025 __pyx_L5_argtuple_error:;
19026 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 859, __pyx_L3_error)
19028 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19029 __Pyx_RefNannyFinishContext();
19031 __pyx_L4_argument_unpacking_done:;
19032 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 865, __pyx_L1_error)
19033 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 866, __pyx_L1_error)
19034 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
19041 __Pyx_RefNannyFinishContext();
19045 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19049 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19050 __Pyx_Buffer __pyx_pybuffer_v;
19051 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19052 __Pyx_Buffer __pyx_pybuffer_x;
19053 PyObject *__pyx_r = NULL;
19054 __Pyx_RefNannyDeclarations
19056 npy_intp __pyx_t_2;
19057 npy_intp __pyx_t_3;
19059 npy_intp __pyx_t_5;
19060 npy_intp __pyx_t_6;
19062 Py_ssize_t __pyx_t_8;
19063 Py_ssize_t __pyx_t_9;
19064 Py_ssize_t __pyx_t_10;
19066 Py_ssize_t __pyx_t_12;
19067 Py_ssize_t __pyx_t_13;
19068 Py_ssize_t __pyx_t_14;
19069 PyObject *__pyx_t_15 = NULL;
19070 PyObject *__pyx_t_16 = NULL;
19071 PyObject *__pyx_t_17 = NULL;
19074 PyObject *__pyx_t_20 = NULL;
19075 int __pyx_lineno = 0;
19076 const char *__pyx_filename = NULL;
19077 int __pyx_clineno = 0;
19078 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3", 0);
19079 __pyx_pybuffer_x.pybuffer.buf = NULL;
19080 __pyx_pybuffer_x.refcount = 0;
19081 __pyx_pybuffernd_x.data = NULL;
19082 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19083 __pyx_pybuffer_v.pybuffer.buf = NULL;
19084 __pyx_pybuffer_v.refcount = 0;
19085 __pyx_pybuffernd_v.data = NULL;
19086 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19088 __Pyx_BufFmt_StackElem __pyx_stack[1];
19089 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
19091 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
19093 __Pyx_BufFmt_StackElem __pyx_stack[1];
19094 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
19096 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
19114 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
19124 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19125 __pyx_t_3 = __pyx_t_2;
19126 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19127 __pyx_v_eN = __pyx_t_4;
19136 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19137 __pyx_t_6 = __pyx_t_5;
19138 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19139 __pyx_v_k = __pyx_t_7;
19148 __pyx_t_8 = __pyx_v_eN;
19149 __pyx_t_9 = __pyx_v_k;
19152 if (__pyx_t_8 < 0) {
19153 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
19154 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
19155 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19156 if (__pyx_t_9 < 0) {
19157 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19158 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19159 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19160 if (__pyx_t_10 < 0) {
19161 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
19162 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
19163 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19164 if (unlikely(__pyx_t_11 != -1)) {
19165 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19166 __PYX_ERR(0, 873, __pyx_L1_error)
19168 __pyx_t_12 = __pyx_v_eN;
19169 __pyx_t_13 = __pyx_v_k;
19172 if (__pyx_t_12 < 0) {
19173 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
19174 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
19175 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19176 if (__pyx_t_13 < 0) {
19177 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19178 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19179 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19180 if (__pyx_t_14 < 0) {
19181 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
19182 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
19183 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19184 if (unlikely(__pyx_t_11 != -1)) {
19185 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19186 __PYX_ERR(0, 873, __pyx_L1_error)
19188 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
19197 __pyx_t_10 = __pyx_v_eN;
19198 __pyx_t_9 = __pyx_v_k;
19201 if (__pyx_t_10 < 0) {
19202 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
19203 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
19204 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19205 if (__pyx_t_9 < 0) {
19206 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19207 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19208 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19209 if (__pyx_t_8 < 0) {
19210 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
19211 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
19212 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19213 if (unlikely(__pyx_t_11 != -1)) {
19214 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19215 __PYX_ERR(0, 874, __pyx_L1_error)
19217 __pyx_t_14 = __pyx_v_eN;
19218 __pyx_t_13 = __pyx_v_k;
19221 if (__pyx_t_14 < 0) {
19222 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
19223 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
19224 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19225 if (__pyx_t_13 < 0) {
19226 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19227 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19228 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19229 if (__pyx_t_12 < 0) {
19230 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
19231 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
19232 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19233 if (unlikely(__pyx_t_11 != -1)) {
19234 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19235 __PYX_ERR(0, 874, __pyx_L1_error)
19237 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
19246 __pyx_t_8 = __pyx_v_eN;
19247 __pyx_t_9 = __pyx_v_k;
19250 if (__pyx_t_8 < 0) {
19251 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[0].shape;
19252 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
19253 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19254 if (__pyx_t_9 < 0) {
19255 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
19256 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19257 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19258 if (__pyx_t_10 < 0) {
19259 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[2].shape;
19260 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
19261 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19262 if (unlikely(__pyx_t_11 != -1)) {
19263 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19264 __PYX_ERR(0, 875, __pyx_L1_error)
19266 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
19275 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 876, __pyx_L1_error)
19276 __Pyx_GOTREF(__pyx_t_15);
19277 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 876, __pyx_L1_error)
19278 __Pyx_GOTREF(__pyx_t_16);
19279 __pyx_t_17 = PyTuple_New(3);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 876, __pyx_L1_error)
19280 __Pyx_GOTREF(__pyx_t_17);
19281 __Pyx_GIVEREF(__pyx_t_15);
19282 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15);
19283 __Pyx_GIVEREF(__pyx_t_16);
19284 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16);
19285 __Pyx_INCREF(__pyx_slice_);
19286 __Pyx_GIVEREF(__pyx_slice_);
19287 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_slice_);
19290 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 876, __pyx_L1_error)
19291 __Pyx_GOTREF(__pyx_t_16);
19292 __pyx_t_18 = (__pyx_v_pi * __pyx_v_t);
19293 __pyx_t_19 = (__pyx_v_tForReversal * 2.0);
19294 if (unlikely(__pyx_t_19 == 0)) {
19295 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
19296 __PYX_ERR(0, 876, __pyx_L1_error)
19298 __pyx_t_15 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_18 / __pyx_t_19))));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 876, __pyx_L1_error)
19299 __Pyx_GOTREF(__pyx_t_15);
19300 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 876, __pyx_L1_error)
19301 __Pyx_GOTREF(__pyx_t_20);
19302 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
19303 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
19304 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_17, __pyx_t_20) < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
19305 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
19306 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
19328 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19329 __pyx_t_3 = __pyx_t_2;
19330 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19331 __pyx_v_eN = __pyx_t_4;
19340 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19341 __pyx_t_6 = __pyx_t_5;
19342 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19343 __pyx_v_k = __pyx_t_7;
19352 __pyx_t_10 = __pyx_v_eN;
19353 __pyx_t_9 = __pyx_v_k;
19356 if (__pyx_t_10 < 0) {
19357 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
19358 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
19359 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19360 if (__pyx_t_9 < 0) {
19361 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19362 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19363 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19364 if (__pyx_t_8 < 0) {
19365 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
19366 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
19367 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19368 if (unlikely(__pyx_t_11 != -1)) {
19369 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19370 __PYX_ERR(0, 880, __pyx_L1_error)
19372 __pyx_t_12 = __pyx_v_eN;
19373 __pyx_t_13 = __pyx_v_k;
19376 if (__pyx_t_12 < 0) {
19377 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
19378 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
19379 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19380 if (__pyx_t_13 < 0) {
19381 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19382 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19383 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19384 if (__pyx_t_14 < 0) {
19385 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
19386 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
19387 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19388 if (unlikely(__pyx_t_11 != -1)) {
19389 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19390 __PYX_ERR(0, 880, __pyx_L1_error)
19392 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
19401 __pyx_t_8 = __pyx_v_eN;
19402 __pyx_t_9 = __pyx_v_k;
19405 if (__pyx_t_8 < 0) {
19406 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
19407 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
19408 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19409 if (__pyx_t_9 < 0) {
19410 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19411 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19412 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19413 if (__pyx_t_10 < 0) {
19414 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
19415 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
19416 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19417 if (unlikely(__pyx_t_11 != -1)) {
19418 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19419 __PYX_ERR(0, 881, __pyx_L1_error)
19421 __pyx_t_14 = __pyx_v_eN;
19422 __pyx_t_13 = __pyx_v_k;
19425 if (__pyx_t_14 < 0) {
19426 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
19427 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
19428 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19429 if (__pyx_t_13 < 0) {
19430 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19431 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19432 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19433 if (__pyx_t_12 < 0) {
19434 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
19435 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
19436 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19437 if (unlikely(__pyx_t_11 != -1)) {
19438 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19439 __PYX_ERR(0, 881, __pyx_L1_error)
19441 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides))));
19450 __pyx_t_10 = __pyx_v_eN;
19451 __pyx_t_9 = __pyx_v_k;
19454 if (__pyx_t_10 < 0) {
19455 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
19456 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
19457 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19458 if (__pyx_t_9 < 0) {
19459 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
19460 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19461 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19462 if (__pyx_t_8 < 0) {
19463 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[2].shape;
19464 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
19465 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19466 if (unlikely(__pyx_t_11 != -1)) {
19467 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19468 __PYX_ERR(0, 882, __pyx_L1_error)
19470 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
19485 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19488 __Pyx_XDECREF(__pyx_t_15);
19489 __Pyx_XDECREF(__pyx_t_16);
19490 __Pyx_XDECREF(__pyx_t_17);
19491 __Pyx_XDECREF(__pyx_t_20);
19492 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19493 __Pyx_PyThreadState_declare
19494 __Pyx_PyThreadState_assign
19495 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19496 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19497 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19498 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19499 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19503 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19504 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19506 __Pyx_XGIVEREF(__pyx_r);
19507 __Pyx_RefNannyFinishContext();
19520 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19521 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4 = {
"helicalElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
19522 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19523 int __pyx_v_transient;
19525 double __pyx_v_tForReversal;
19526 double __pyx_v_clock;
19527 double __pyx_v_zVelocity;
19530 PyArrayObject *__pyx_v_x = 0;
19531 PyArrayObject *__pyx_v_v = 0;
19532 int __pyx_lineno = 0;
19533 const char *__pyx_filename = NULL;
19534 int __pyx_clineno = 0;
19535 PyObject *__pyx_r = 0;
19536 __Pyx_RefNannyDeclarations
19537 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4 (wrapper)", 0);
19539 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
19540 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
19541 if (unlikely(__pyx_kwds)) {
19542 Py_ssize_t kw_args;
19543 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19544 switch (pos_args) {
19545 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19546 CYTHON_FALLTHROUGH;
19547 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19548 CYTHON_FALLTHROUGH;
19549 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19550 CYTHON_FALLTHROUGH;
19551 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19552 CYTHON_FALLTHROUGH;
19553 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19554 CYTHON_FALLTHROUGH;
19555 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19556 CYTHON_FALLTHROUGH;
19557 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19558 CYTHON_FALLTHROUGH;
19559 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19560 CYTHON_FALLTHROUGH;
19561 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19562 CYTHON_FALLTHROUGH;
19564 default:
goto __pyx_L5_argtuple_error;
19566 kw_args = PyDict_Size(__pyx_kwds);
19567 switch (pos_args) {
19569 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
19570 else goto __pyx_L5_argtuple_error;
19571 CYTHON_FALLTHROUGH;
19573 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
19575 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 1); __PYX_ERR(0, 884, __pyx_L3_error)
19577 CYTHON_FALLTHROUGH;
19579 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
19581 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 2); __PYX_ERR(0, 884, __pyx_L3_error)
19583 CYTHON_FALLTHROUGH;
19585 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
19587 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 3); __PYX_ERR(0, 884, __pyx_L3_error)
19589 CYTHON_FALLTHROUGH;
19591 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
19593 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 4); __PYX_ERR(0, 884, __pyx_L3_error)
19595 CYTHON_FALLTHROUGH;
19597 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
19599 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 5); __PYX_ERR(0, 884, __pyx_L3_error)
19601 CYTHON_FALLTHROUGH;
19603 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
19605 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 6); __PYX_ERR(0, 884, __pyx_L3_error)
19607 CYTHON_FALLTHROUGH;
19609 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
19611 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 7); __PYX_ERR(0, 884, __pyx_L3_error)
19613 CYTHON_FALLTHROUGH;
19615 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
19617 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 8); __PYX_ERR(0, 884, __pyx_L3_error)
19620 if (unlikely(kw_args > 0)) {
19621 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval4") < 0)) __PYX_ERR(0, 884, __pyx_L3_error)
19623 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
19624 goto __pyx_L5_argtuple_error;
19626 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19627 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19628 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19629 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19630 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19631 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19632 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19633 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19634 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19636 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L3_error)
19637 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L3_error)
19638 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L3_error)
19639 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L3_error)
19640 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
19641 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19642 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19643 __pyx_v_x = ((PyArrayObject *)values[7]);
19644 __pyx_v_v = ((PyArrayObject *)values[8]);
19646 goto __pyx_L4_argument_unpacking_done;
19647 __pyx_L5_argtuple_error:;
19648 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error)
19650 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19651 __Pyx_RefNannyFinishContext();
19653 __pyx_L4_argument_unpacking_done:;
19654 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
19655 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 891, __pyx_L1_error)
19656 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
19663 __Pyx_RefNannyFinishContext();
19667 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19672 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19673 __Pyx_Buffer __pyx_pybuffer_v;
19674 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19675 __Pyx_Buffer __pyx_pybuffer_x;
19676 PyObject *__pyx_r = NULL;
19677 __Pyx_RefNannyDeclarations
19679 npy_intp __pyx_t_2;
19680 npy_intp __pyx_t_3;
19682 npy_intp __pyx_t_5;
19683 npy_intp __pyx_t_6;
19685 npy_intp __pyx_t_8;
19686 npy_intp __pyx_t_9;
19688 Py_ssize_t __pyx_t_11;
19689 Py_ssize_t __pyx_t_12;
19690 Py_ssize_t __pyx_t_13;
19691 Py_ssize_t __pyx_t_14;
19693 Py_ssize_t __pyx_t_16;
19694 Py_ssize_t __pyx_t_17;
19695 Py_ssize_t __pyx_t_18;
19696 Py_ssize_t __pyx_t_19;
19697 PyObject *__pyx_t_20 = NULL;
19698 PyObject *__pyx_t_21 = NULL;
19699 PyObject *__pyx_t_22 = NULL;
19700 PyObject *__pyx_t_23 = NULL;
19703 int __pyx_lineno = 0;
19704 const char *__pyx_filename = NULL;
19705 int __pyx_clineno = 0;
19706 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4", 0);
19707 __pyx_pybuffer_x.pybuffer.buf = NULL;
19708 __pyx_pybuffer_x.refcount = 0;
19709 __pyx_pybuffernd_x.data = NULL;
19710 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19711 __pyx_pybuffer_v.pybuffer.buf = NULL;
19712 __pyx_pybuffer_v.refcount = 0;
19713 __pyx_pybuffernd_v.data = NULL;
19714 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19716 __Pyx_BufFmt_StackElem __pyx_stack[1];
19717 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19719 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
19721 __Pyx_BufFmt_StackElem __pyx_stack[1];
19722 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19724 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
19742 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
19752 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19753 __pyx_t_3 = __pyx_t_2;
19754 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19755 __pyx_v_eN = __pyx_t_4;
19764 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19765 __pyx_t_6 = __pyx_t_5;
19766 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19767 __pyx_v_ebN = __pyx_t_7;
19776 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
19777 __pyx_t_9 = __pyx_t_8;
19778 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
19779 __pyx_v_k = __pyx_t_10;
19788 __pyx_t_11 = __pyx_v_eN;
19789 __pyx_t_12 = __pyx_v_ebN;
19790 __pyx_t_13 = __pyx_v_k;
19793 if (__pyx_t_11 < 0) {
19794 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
19795 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
19796 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
19797 if (__pyx_t_12 < 0) {
19798 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
19799 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
19800 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
19801 if (__pyx_t_13 < 0) {
19802 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
19803 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
19804 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
19805 if (__pyx_t_14 < 0) {
19806 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
19807 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
19808 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
19809 if (unlikely(__pyx_t_15 != -1)) {
19810 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19811 __PYX_ERR(0, 899, __pyx_L1_error)
19813 __pyx_t_16 = __pyx_v_eN;
19814 __pyx_t_17 = __pyx_v_ebN;
19815 __pyx_t_18 = __pyx_v_k;
19818 if (__pyx_t_16 < 0) {
19819 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
19820 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
19821 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
19822 if (__pyx_t_17 < 0) {
19823 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
19824 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
19825 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
19826 if (__pyx_t_18 < 0) {
19827 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
19828 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
19829 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
19830 if (__pyx_t_19 < 0) {
19831 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
19832 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
19833 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
19834 if (unlikely(__pyx_t_15 != -1)) {
19835 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19836 __PYX_ERR(0, 899, __pyx_L1_error)
19838 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
19847 __pyx_t_14 = __pyx_v_eN;
19848 __pyx_t_13 = __pyx_v_ebN;
19849 __pyx_t_12 = __pyx_v_k;
19852 if (__pyx_t_14 < 0) {
19853 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
19854 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
19855 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
19856 if (__pyx_t_13 < 0) {
19857 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
19858 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
19859 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
19860 if (__pyx_t_12 < 0) {
19861 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
19862 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
19863 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
19864 if (__pyx_t_11 < 0) {
19865 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
19866 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
19867 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
19868 if (unlikely(__pyx_t_15 != -1)) {
19869 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19870 __PYX_ERR(0, 900, __pyx_L1_error)
19872 __pyx_t_19 = __pyx_v_eN;
19873 __pyx_t_18 = __pyx_v_ebN;
19874 __pyx_t_17 = __pyx_v_k;
19877 if (__pyx_t_19 < 0) {
19878 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
19879 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
19880 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
19881 if (__pyx_t_18 < 0) {
19882 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
19883 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
19884 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
19885 if (__pyx_t_17 < 0) {
19886 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
19887 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
19888 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
19889 if (__pyx_t_16 < 0) {
19890 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
19891 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
19892 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
19893 if (unlikely(__pyx_t_15 != -1)) {
19894 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19895 __PYX_ERR(0, 900, __pyx_L1_error)
19897 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
19906 __pyx_t_11 = __pyx_v_eN;
19907 __pyx_t_12 = __pyx_v_ebN;
19908 __pyx_t_13 = __pyx_v_k;
19911 if (__pyx_t_11 < 0) {
19912 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[0].shape;
19913 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
19914 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
19915 if (__pyx_t_12 < 0) {
19916 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[1].shape;
19917 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
19918 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
19919 if (__pyx_t_13 < 0) {
19920 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[2].shape;
19921 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
19922 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
19923 if (__pyx_t_14 < 0) {
19924 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[3].shape;
19925 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
19926 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
19927 if (unlikely(__pyx_t_15 != -1)) {
19928 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19929 __PYX_ERR(0, 901, __pyx_L1_error)
19931 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
19940 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 902, __pyx_L1_error)
19941 __Pyx_GOTREF(__pyx_t_20);
19942 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 902, __pyx_L1_error)
19943 __Pyx_GOTREF(__pyx_t_21);
19944 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 902, __pyx_L1_error)
19945 __Pyx_GOTREF(__pyx_t_22);
19946 __pyx_t_23 = PyTuple_New(4);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 902, __pyx_L1_error)
19947 __Pyx_GOTREF(__pyx_t_23);
19948 __Pyx_GIVEREF(__pyx_t_20);
19949 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20);
19950 __Pyx_GIVEREF(__pyx_t_21);
19951 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21);
19952 __Pyx_GIVEREF(__pyx_t_22);
19953 PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_22);
19954 __Pyx_INCREF(__pyx_slice_);
19955 __Pyx_GIVEREF(__pyx_slice_);
19956 PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_slice_);
19960 __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_23);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 902, __pyx_L1_error)
19961 __Pyx_GOTREF(__pyx_t_22);
19962 __pyx_t_24 = (__pyx_v_pi * __pyx_v_t);
19963 __pyx_t_25 = (__pyx_v_tForReversal * 2.0);
19964 if (unlikely(__pyx_t_25 == 0)) {
19965 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
19966 __PYX_ERR(0, 902, __pyx_L1_error)
19968 __pyx_t_21 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_24 / __pyx_t_25))));
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 902, __pyx_L1_error)
19969 __Pyx_GOTREF(__pyx_t_21);
19970 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_22, __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 902, __pyx_L1_error)
19971 __Pyx_GOTREF(__pyx_t_20);
19972 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
19973 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
19974 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_23, __pyx_t_20) < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
19975 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
19976 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
19999 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
20000 __pyx_t_3 = __pyx_t_2;
20001 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20002 __pyx_v_eN = __pyx_t_4;
20011 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
20012 __pyx_t_6 = __pyx_t_5;
20013 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
20014 __pyx_v_ebN = __pyx_t_7;
20023 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
20024 __pyx_t_9 = __pyx_t_8;
20025 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
20026 __pyx_v_k = __pyx_t_10;
20035 __pyx_t_14 = __pyx_v_eN;
20036 __pyx_t_13 = __pyx_v_ebN;
20037 __pyx_t_12 = __pyx_v_k;
20040 if (__pyx_t_14 < 0) {
20041 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
20042 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
20043 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20044 if (__pyx_t_13 < 0) {
20045 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
20046 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
20047 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20048 if (__pyx_t_12 < 0) {
20049 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
20050 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
20051 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20052 if (__pyx_t_11 < 0) {
20053 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
20054 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
20055 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20056 if (unlikely(__pyx_t_15 != -1)) {
20057 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20058 __PYX_ERR(0, 907, __pyx_L1_error)
20060 __pyx_t_16 = __pyx_v_eN;
20061 __pyx_t_17 = __pyx_v_ebN;
20062 __pyx_t_18 = __pyx_v_k;
20065 if (__pyx_t_16 < 0) {
20066 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
20067 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
20068 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20069 if (__pyx_t_17 < 0) {
20070 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
20071 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
20072 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20073 if (__pyx_t_18 < 0) {
20074 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
20075 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
20076 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20077 if (__pyx_t_19 < 0) {
20078 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
20079 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
20080 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20081 if (unlikely(__pyx_t_15 != -1)) {
20082 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20083 __PYX_ERR(0, 907, __pyx_L1_error)
20085 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
20094 __pyx_t_11 = __pyx_v_eN;
20095 __pyx_t_12 = __pyx_v_ebN;
20096 __pyx_t_13 = __pyx_v_k;
20099 if (__pyx_t_11 < 0) {
20100 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
20101 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
20102 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20103 if (__pyx_t_12 < 0) {
20104 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20105 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
20106 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20107 if (__pyx_t_13 < 0) {
20108 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
20109 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
20110 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20111 if (__pyx_t_14 < 0) {
20112 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
20113 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
20114 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20115 if (unlikely(__pyx_t_15 != -1)) {
20116 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20117 __PYX_ERR(0, 908, __pyx_L1_error)
20119 __pyx_t_19 = __pyx_v_eN;
20120 __pyx_t_18 = __pyx_v_ebN;
20121 __pyx_t_17 = __pyx_v_k;
20124 if (__pyx_t_19 < 0) {
20125 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
20126 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
20127 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20128 if (__pyx_t_18 < 0) {
20129 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
20130 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
20131 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20132 if (__pyx_t_17 < 0) {
20133 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
20134 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
20135 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20136 if (__pyx_t_16 < 0) {
20137 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
20138 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
20139 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20140 if (unlikely(__pyx_t_15 != -1)) {
20141 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20142 __PYX_ERR(0, 908, __pyx_L1_error)
20144 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides))));
20153 __pyx_t_14 = __pyx_v_eN;
20154 __pyx_t_13 = __pyx_v_ebN;
20155 __pyx_t_12 = __pyx_v_k;
20158 if (__pyx_t_14 < 0) {
20159 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
20160 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
20161 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20162 if (__pyx_t_13 < 0) {
20163 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
20164 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
20165 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20166 if (__pyx_t_12 < 0) {
20167 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
20168 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
20169 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20170 if (__pyx_t_11 < 0) {
20171 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[3].shape;
20172 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
20173 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20174 if (unlikely(__pyx_t_15 != -1)) {
20175 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20176 __PYX_ERR(0, 909, __pyx_L1_error)
20178 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
20194 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20197 __Pyx_XDECREF(__pyx_t_20);
20198 __Pyx_XDECREF(__pyx_t_21);
20199 __Pyx_XDECREF(__pyx_t_22);
20200 __Pyx_XDECREF(__pyx_t_23);
20201 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20202 __Pyx_PyThreadState_declare
20203 __Pyx_PyThreadState_assign
20204 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20205 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20206 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20207 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20208 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20212 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20213 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20215 __Pyx_XGIVEREF(__pyx_r);
20216 __Pyx_RefNannyFinishContext();
20229 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20230 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3 = {
"vortexElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
20231 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20233 PyArrayObject *__pyx_v_x = 0;
20234 PyArrayObject *__pyx_v_v = 0;
20235 int __pyx_lineno = 0;
20236 const char *__pyx_filename = NULL;
20237 int __pyx_clineno = 0;
20238 PyObject *__pyx_r = 0;
20239 __Pyx_RefNannyDeclarations
20240 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3 (wrapper)", 0);
20242 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
20243 PyObject* values[3] = {0,0,0};
20244 if (unlikely(__pyx_kwds)) {
20245 Py_ssize_t kw_args;
20246 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20247 switch (pos_args) {
20248 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20249 CYTHON_FALLTHROUGH;
20250 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20251 CYTHON_FALLTHROUGH;
20252 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20253 CYTHON_FALLTHROUGH;
20255 default:
goto __pyx_L5_argtuple_error;
20257 kw_args = PyDict_Size(__pyx_kwds);
20258 switch (pos_args) {
20260 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
20261 else goto __pyx_L5_argtuple_error;
20262 CYTHON_FALLTHROUGH;
20264 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
20266 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 1); __PYX_ERR(0, 911, __pyx_L3_error)
20268 CYTHON_FALLTHROUGH;
20270 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
20272 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 2); __PYX_ERR(0, 911, __pyx_L3_error)
20275 if (unlikely(kw_args > 0)) {
20276 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval3") < 0)) __PYX_ERR(0, 911, __pyx_L3_error)
20278 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20279 goto __pyx_L5_argtuple_error;
20281 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20282 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20283 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20285 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error)
20286 __pyx_v_x = ((PyArrayObject *)values[1]);
20287 __pyx_v_v = ((PyArrayObject *)values[2]);
20289 goto __pyx_L4_argument_unpacking_done;
20290 __pyx_L5_argtuple_error:;
20291 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 911, __pyx_L3_error)
20293 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20294 __Pyx_RefNannyFinishContext();
20296 __pyx_L4_argument_unpacking_done:;
20297 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 912, __pyx_L1_error)
20298 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 913, __pyx_L1_error)
20299 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
20306 __Pyx_RefNannyFinishContext();
20310 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
20314 double __pyx_v_one8;
20315 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20316 __Pyx_Buffer __pyx_pybuffer_v;
20317 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
20318 __Pyx_Buffer __pyx_pybuffer_x;
20319 PyObject *__pyx_r = NULL;
20320 __Pyx_RefNannyDeclarations
20321 npy_intp __pyx_t_1;
20322 npy_intp __pyx_t_2;
20324 npy_intp __pyx_t_4;
20325 npy_intp __pyx_t_5;
20327 Py_ssize_t __pyx_t_7;
20328 Py_ssize_t __pyx_t_8;
20329 Py_ssize_t __pyx_t_9;
20331 Py_ssize_t __pyx_t_11;
20332 Py_ssize_t __pyx_t_12;
20333 Py_ssize_t __pyx_t_13;
20334 Py_ssize_t __pyx_t_14;
20335 Py_ssize_t __pyx_t_15;
20336 Py_ssize_t __pyx_t_16;
20337 Py_ssize_t __pyx_t_17;
20338 Py_ssize_t __pyx_t_18;
20339 Py_ssize_t __pyx_t_19;
20340 int __pyx_lineno = 0;
20341 const char *__pyx_filename = NULL;
20342 int __pyx_clineno = 0;
20343 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3", 0);
20344 __pyx_pybuffer_x.pybuffer.buf = NULL;
20345 __pyx_pybuffer_x.refcount = 0;
20346 __pyx_pybuffernd_x.data = NULL;
20347 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
20348 __pyx_pybuffer_v.pybuffer.buf = NULL;
20349 __pyx_pybuffer_v.refcount = 0;
20350 __pyx_pybuffernd_v.data = NULL;
20351 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20353 __Pyx_BufFmt_StackElem __pyx_stack[1];
20354 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
20356 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
20358 __Pyx_BufFmt_StackElem __pyx_stack[1];
20359 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
20361 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
20379 __pyx_v_one8 = (1.0 / 8.0);
20388 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
20389 __pyx_t_2 = __pyx_t_1;
20390 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20391 __pyx_v_eN = __pyx_t_3;
20400 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
20401 __pyx_t_5 = __pyx_t_4;
20402 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20403 __pyx_v_k = __pyx_t_6;
20412 __pyx_t_7 = __pyx_v_eN;
20413 __pyx_t_8 = __pyx_v_k;
20416 if (__pyx_t_7 < 0) {
20417 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[0].shape;
20418 if (unlikely(__pyx_t_7 < 0)) __pyx_t_10 = 0;
20419 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20420 if (__pyx_t_8 < 0) {
20421 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
20422 if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 1;
20423 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20424 if (__pyx_t_9 < 0) {
20425 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[2].shape;
20426 if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 2;
20427 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20428 if (unlikely(__pyx_t_10 != -1)) {
20429 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20430 __PYX_ERR(0, 920, __pyx_L1_error)
20432 __pyx_t_11 = __pyx_v_eN;
20433 __pyx_t_12 = __pyx_v_k;
20436 if (__pyx_t_11 < 0) {
20437 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
20438 if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
20439 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20440 if (__pyx_t_12 < 0) {
20441 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20442 if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 1;
20443 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20444 if (__pyx_t_13 < 0) {
20445 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
20446 if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 2;
20447 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20448 if (unlikely(__pyx_t_10 != -1)) {
20449 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20450 __PYX_ERR(0, 920, __pyx_L1_error)
20452 __pyx_t_14 = __pyx_v_eN;
20453 __pyx_t_15 = __pyx_v_k;
20456 if (__pyx_t_14 < 0) {
20457 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
20458 if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
20459 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20460 if (__pyx_t_15 < 0) {
20461 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[1].shape;
20462 if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 1;
20463 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20464 if (__pyx_t_16 < 0) {
20465 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[2].shape;
20466 if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 2;
20467 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20468 if (unlikely(__pyx_t_10 != -1)) {
20469 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20470 __PYX_ERR(0, 920, __pyx_L1_error)
20472 __pyx_t_17 = __pyx_v_eN;
20473 __pyx_t_18 = __pyx_v_k;
20476 if (__pyx_t_17 < 0) {
20477 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[0].shape;
20478 if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
20479 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
20480 if (__pyx_t_18 < 0) {
20481 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
20482 if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 1;
20483 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
20484 if (__pyx_t_19 < 0) {
20485 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[2].shape;
20486 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 2;
20487 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
20488 if (unlikely(__pyx_t_10 != -1)) {
20489 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20490 __PYX_ERR(0, 920, __pyx_L1_error)
20492 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[2].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[2].strides)))));
20501 __pyx_t_16 = __pyx_v_eN;
20502 __pyx_t_15 = __pyx_v_k;
20505 if (__pyx_t_16 < 0) {
20506 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape;
20507 if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
20508 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20509 if (__pyx_t_15 < 0) {
20510 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[1].shape;
20511 if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 1;
20512 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20513 if (__pyx_t_14 < 0) {
20514 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[2].shape;
20515 if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 2;
20516 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20517 if (unlikely(__pyx_t_10 != -1)) {
20518 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20519 __PYX_ERR(0, 921, __pyx_L1_error)
20521 __pyx_t_13 = __pyx_v_eN;
20522 __pyx_t_12 = __pyx_v_k;
20525 if (__pyx_t_13 < 0) {
20526 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
20527 if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0;
20528 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20529 if (__pyx_t_12 < 0) {
20530 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20531 if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 1;
20532 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20533 if (__pyx_t_11 < 0) {
20534 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[2].shape;
20535 if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 2;
20536 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20537 if (unlikely(__pyx_t_10 != -1)) {
20538 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20539 __PYX_ERR(0, 921, __pyx_L1_error)
20541 __pyx_t_9 = __pyx_v_eN;
20542 __pyx_t_8 = __pyx_v_k;
20545 if (__pyx_t_9 < 0) {
20546 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[0].shape;
20547 if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
20548 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20549 if (__pyx_t_8 < 0) {
20550 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
20551 if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 1;
20552 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20553 if (__pyx_t_7 < 0) {
20554 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[2].shape;
20555 if (unlikely(__pyx_t_7 < 0)) __pyx_t_10 = 2;
20556 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20557 if (unlikely(__pyx_t_10 != -1)) {
20558 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20559 __PYX_ERR(0, 921, __pyx_L1_error)
20561 __pyx_t_19 = __pyx_v_eN;
20562 __pyx_t_18 = __pyx_v_k;
20565 if (__pyx_t_19 < 0) {
20566 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
20567 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
20568 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
20569 if (__pyx_t_18 < 0) {
20570 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
20571 if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 1;
20572 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
20573 if (__pyx_t_17 < 0) {
20574 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
20575 if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 2;
20576 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
20577 if (unlikely(__pyx_t_10 != -1)) {
20578 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20579 __PYX_ERR(0, 921, __pyx_L1_error)
20581 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_7, __pyx_pybuffernd_x.diminfo[2].strides)))));
20594 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20597 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20598 __Pyx_PyThreadState_declare
20599 __Pyx_PyThreadState_assign
20600 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20601 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20602 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20603 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20604 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20608 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20609 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20611 __Pyx_XGIVEREF(__pyx_r);
20612 __Pyx_RefNannyFinishContext();
20625 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20626 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4 = {
"vortexElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
20627 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20629 PyArrayObject *__pyx_v_x = 0;
20630 PyArrayObject *__pyx_v_v = 0;
20631 int __pyx_lineno = 0;
20632 const char *__pyx_filename = NULL;
20633 int __pyx_clineno = 0;
20634 PyObject *__pyx_r = 0;
20635 __Pyx_RefNannyDeclarations
20636 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4 (wrapper)", 0);
20638 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
20639 PyObject* values[3] = {0,0,0};
20640 if (unlikely(__pyx_kwds)) {
20641 Py_ssize_t kw_args;
20642 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20643 switch (pos_args) {
20644 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20645 CYTHON_FALLTHROUGH;
20646 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20647 CYTHON_FALLTHROUGH;
20648 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20649 CYTHON_FALLTHROUGH;
20651 default:
goto __pyx_L5_argtuple_error;
20653 kw_args = PyDict_Size(__pyx_kwds);
20654 switch (pos_args) {
20656 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
20657 else goto __pyx_L5_argtuple_error;
20658 CYTHON_FALLTHROUGH;
20660 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
20662 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 1); __PYX_ERR(0, 924, __pyx_L3_error)
20664 CYTHON_FALLTHROUGH;
20666 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
20668 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 2); __PYX_ERR(0, 924, __pyx_L3_error)
20671 if (unlikely(kw_args > 0)) {
20672 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval4") < 0)) __PYX_ERR(0, 924, __pyx_L3_error)
20674 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20675 goto __pyx_L5_argtuple_error;
20677 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20678 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20679 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20681 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 924, __pyx_L3_error)
20682 __pyx_v_x = ((PyArrayObject *)values[1]);
20683 __pyx_v_v = ((PyArrayObject *)values[2]);
20685 goto __pyx_L4_argument_unpacking_done;
20686 __pyx_L5_argtuple_error:;
20687 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 924, __pyx_L3_error)
20689 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20690 __Pyx_RefNannyFinishContext();
20692 __pyx_L4_argument_unpacking_done:;
20693 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 925, __pyx_L1_error)
20694 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 926, __pyx_L1_error)
20695 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
20702 __Pyx_RefNannyFinishContext();
20706 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
20711 double __pyx_v_one8;
20712 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20713 __Pyx_Buffer __pyx_pybuffer_v;
20714 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
20715 __Pyx_Buffer __pyx_pybuffer_x;
20716 PyObject *__pyx_r = NULL;
20717 __Pyx_RefNannyDeclarations
20718 npy_intp __pyx_t_1;
20719 npy_intp __pyx_t_2;
20721 npy_intp __pyx_t_4;
20722 npy_intp __pyx_t_5;
20724 npy_intp __pyx_t_7;
20725 npy_intp __pyx_t_8;
20727 Py_ssize_t __pyx_t_10;
20728 Py_ssize_t __pyx_t_11;
20729 Py_ssize_t __pyx_t_12;
20730 Py_ssize_t __pyx_t_13;
20732 Py_ssize_t __pyx_t_15;
20733 Py_ssize_t __pyx_t_16;
20734 Py_ssize_t __pyx_t_17;
20735 Py_ssize_t __pyx_t_18;
20736 Py_ssize_t __pyx_t_19;
20737 Py_ssize_t __pyx_t_20;
20738 Py_ssize_t __pyx_t_21;
20739 Py_ssize_t __pyx_t_22;
20740 Py_ssize_t __pyx_t_23;
20741 Py_ssize_t __pyx_t_24;
20742 Py_ssize_t __pyx_t_25;
20743 Py_ssize_t __pyx_t_26;
20744 int __pyx_lineno = 0;
20745 const char *__pyx_filename = NULL;
20746 int __pyx_clineno = 0;
20747 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4", 0);
20748 __pyx_pybuffer_x.pybuffer.buf = NULL;
20749 __pyx_pybuffer_x.refcount = 0;
20750 __pyx_pybuffernd_x.data = NULL;
20751 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
20752 __pyx_pybuffer_v.pybuffer.buf = NULL;
20753 __pyx_pybuffer_v.refcount = 0;
20754 __pyx_pybuffernd_v.data = NULL;
20755 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20757 __Pyx_BufFmt_StackElem __pyx_stack[1];
20758 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
20760 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
20762 __Pyx_BufFmt_StackElem __pyx_stack[1];
20763 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
20765 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
20783 __pyx_v_one8 = (1.0 / 8.0);
20792 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
20793 __pyx_t_2 = __pyx_t_1;
20794 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20795 __pyx_v_eN = __pyx_t_3;
20804 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
20805 __pyx_t_5 = __pyx_t_4;
20806 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20807 __pyx_v_ebN = __pyx_t_6;
20816 __pyx_t_7 = (__pyx_v_x->dimensions[2]);
20817 __pyx_t_8 = __pyx_t_7;
20818 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
20819 __pyx_v_k = __pyx_t_9;
20828 __pyx_t_10 = __pyx_v_eN;
20829 __pyx_t_11 = __pyx_v_ebN;
20830 __pyx_t_12 = __pyx_v_k;
20833 if (__pyx_t_10 < 0) {
20834 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
20835 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 0;
20836 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20837 if (__pyx_t_11 < 0) {
20838 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[1].shape;
20839 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 1;
20840 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20841 if (__pyx_t_12 < 0) {
20842 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
20843 if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 2;
20844 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20845 if (__pyx_t_13 < 0) {
20846 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[3].shape;
20847 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 3;
20848 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20849 if (unlikely(__pyx_t_14 != -1)) {
20850 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20851 __PYX_ERR(0, 934, __pyx_L1_error)
20853 __pyx_t_15 = __pyx_v_eN;
20854 __pyx_t_16 = __pyx_v_ebN;
20855 __pyx_t_17 = __pyx_v_k;
20858 if (__pyx_t_15 < 0) {
20859 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape;
20860 if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 0;
20861 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20862 if (__pyx_t_16 < 0) {
20863 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[1].shape;
20864 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 1;
20865 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20866 if (__pyx_t_17 < 0) {
20867 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[2].shape;
20868 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 2;
20869 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20870 if (__pyx_t_18 < 0) {
20871 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[3].shape;
20872 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 3;
20873 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20874 if (unlikely(__pyx_t_14 != -1)) {
20875 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20876 __PYX_ERR(0, 934, __pyx_L1_error)
20878 __pyx_t_19 = __pyx_v_eN;
20879 __pyx_t_20 = __pyx_v_ebN;
20880 __pyx_t_21 = __pyx_v_k;
20883 if (__pyx_t_19 < 0) {
20884 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[0].shape;
20885 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 0;
20886 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20887 if (__pyx_t_20 < 0) {
20888 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[1].shape;
20889 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 1;
20890 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20891 if (__pyx_t_21 < 0) {
20892 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[2].shape;
20893 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 2;
20894 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20895 if (__pyx_t_22 < 0) {
20896 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[3].shape;
20897 if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 3;
20898 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20899 if (unlikely(__pyx_t_14 != -1)) {
20900 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20901 __PYX_ERR(0, 934, __pyx_L1_error)
20903 __pyx_t_23 = __pyx_v_eN;
20904 __pyx_t_24 = __pyx_v_ebN;
20905 __pyx_t_25 = __pyx_v_k;
20908 if (__pyx_t_23 < 0) {
20909 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[0].shape;
20910 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 0;
20911 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
20912 if (__pyx_t_24 < 0) {
20913 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[1].shape;
20914 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 1;
20915 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
20916 if (__pyx_t_25 < 0) {
20917 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[2].shape;
20918 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 2;
20919 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
20920 if (__pyx_t_26 < 0) {
20921 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[3].shape;
20922 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 3;
20923 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
20924 if (unlikely(__pyx_t_14 != -1)) {
20925 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20926 __PYX_ERR(0, 934, __pyx_L1_error)
20928 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[3].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[3].strides)))));
20937 __pyx_t_22 = __pyx_v_eN;
20938 __pyx_t_21 = __pyx_v_ebN;
20939 __pyx_t_20 = __pyx_v_k;
20942 if (__pyx_t_22 < 0) {
20943 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[0].shape;
20944 if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 0;
20945 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20946 if (__pyx_t_21 < 0) {
20947 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[1].shape;
20948 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 1;
20949 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20950 if (__pyx_t_20 < 0) {
20951 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[2].shape;
20952 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 2;
20953 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20954 if (__pyx_t_19 < 0) {
20955 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[3].shape;
20956 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 3;
20957 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20958 if (unlikely(__pyx_t_14 != -1)) {
20959 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20960 __PYX_ERR(0, 935, __pyx_L1_error)
20962 __pyx_t_18 = __pyx_v_eN;
20963 __pyx_t_17 = __pyx_v_ebN;
20964 __pyx_t_16 = __pyx_v_k;
20967 if (__pyx_t_18 < 0) {
20968 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[0].shape;
20969 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 0;
20970 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20971 if (__pyx_t_17 < 0) {
20972 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[1].shape;
20973 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 1;
20974 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20975 if (__pyx_t_16 < 0) {
20976 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[2].shape;
20977 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 2;
20978 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20979 if (__pyx_t_15 < 0) {
20980 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[3].shape;
20981 if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 3;
20982 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20983 if (unlikely(__pyx_t_14 != -1)) {
20984 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20985 __PYX_ERR(0, 935, __pyx_L1_error)
20987 __pyx_t_13 = __pyx_v_eN;
20988 __pyx_t_12 = __pyx_v_ebN;
20989 __pyx_t_11 = __pyx_v_k;
20992 if (__pyx_t_13 < 0) {
20993 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
20994 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
20995 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20996 if (__pyx_t_12 < 0) {
20997 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20998 if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 1;
20999 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21000 if (__pyx_t_11 < 0) {
21001 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[2].shape;
21002 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 2;
21003 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21004 if (__pyx_t_10 < 0) {
21005 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[3].shape;
21006 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 3;
21007 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21008 if (unlikely(__pyx_t_14 != -1)) {
21009 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21010 __PYX_ERR(0, 935, __pyx_L1_error)
21012 __pyx_t_26 = __pyx_v_eN;
21013 __pyx_t_25 = __pyx_v_ebN;
21014 __pyx_t_24 = __pyx_v_k;
21017 if (__pyx_t_26 < 0) {
21018 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[0].shape;
21019 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 0;
21020 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
21021 if (__pyx_t_25 < 0) {
21022 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[1].shape;
21023 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 1;
21024 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
21025 if (__pyx_t_24 < 0) {
21026 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[2].shape;
21027 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 2;
21028 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
21029 if (__pyx_t_23 < 0) {
21030 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[3].shape;
21031 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 3;
21032 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
21033 if (unlikely(__pyx_t_14 != -1)) {
21034 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21035 __PYX_ERR(0, 935, __pyx_L1_error)
21037 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[3].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[3].strides)))));
21051 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21054 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
21055 __Pyx_PyThreadState_declare
21056 __Pyx_PyThreadState_assign
21057 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
21058 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
21059 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
21060 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
21061 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
21065 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
21066 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
21068 __Pyx_XGIVEREF(__pyx_r);
21069 __Pyx_RefNannyFinishContext();
21081 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
21082 PyObject *__pyx_r = NULL;
21083 __Pyx_RefNannyDeclarations
21084 PyObject *__pyx_t_1 = NULL;
21085 int __pyx_lineno = 0;
21086 const char *__pyx_filename = NULL;
21087 int __pyx_clineno = 0;
21088 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
21097 __Pyx_XDECREF(__pyx_r);
21098 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
21099 __Pyx_GOTREF(__pyx_t_1);
21100 __pyx_r = __pyx_t_1;
21114 __Pyx_XDECREF(__pyx_t_1);
21115 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
21118 __Pyx_XGIVEREF(__pyx_r);
21119 __Pyx_RefNannyFinishContext();
21131 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
21132 PyObject *__pyx_r = NULL;
21133 __Pyx_RefNannyDeclarations
21134 PyObject *__pyx_t_1 = NULL;
21135 int __pyx_lineno = 0;
21136 const char *__pyx_filename = NULL;
21137 int __pyx_clineno = 0;
21138 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
21147 __Pyx_XDECREF(__pyx_r);
21148 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
21149 __Pyx_GOTREF(__pyx_t_1);
21150 __pyx_r = __pyx_t_1;
21164 __Pyx_XDECREF(__pyx_t_1);
21165 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
21168 __Pyx_XGIVEREF(__pyx_r);
21169 __Pyx_RefNannyFinishContext();
21181 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
21182 PyObject *__pyx_r = NULL;
21183 __Pyx_RefNannyDeclarations
21184 PyObject *__pyx_t_1 = NULL;
21185 int __pyx_lineno = 0;
21186 const char *__pyx_filename = NULL;
21187 int __pyx_clineno = 0;
21188 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
21197 __Pyx_XDECREF(__pyx_r);
21198 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
21199 __Pyx_GOTREF(__pyx_t_1);
21200 __pyx_r = __pyx_t_1;
21214 __Pyx_XDECREF(__pyx_t_1);
21215 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
21218 __Pyx_XGIVEREF(__pyx_r);
21219 __Pyx_RefNannyFinishContext();
21231 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
21232 PyObject *__pyx_r = NULL;
21233 __Pyx_RefNannyDeclarations
21234 PyObject *__pyx_t_1 = NULL;
21235 int __pyx_lineno = 0;
21236 const char *__pyx_filename = NULL;
21237 int __pyx_clineno = 0;
21238 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
21247 __Pyx_XDECREF(__pyx_r);
21248 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
21249 __Pyx_GOTREF(__pyx_t_1);
21250 __pyx_r = __pyx_t_1;
21264 __Pyx_XDECREF(__pyx_t_1);
21265 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
21268 __Pyx_XGIVEREF(__pyx_r);
21269 __Pyx_RefNannyFinishContext();
21281 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
21282 PyObject *__pyx_r = NULL;
21283 __Pyx_RefNannyDeclarations
21284 PyObject *__pyx_t_1 = NULL;
21285 int __pyx_lineno = 0;
21286 const char *__pyx_filename = NULL;
21287 int __pyx_clineno = 0;
21288 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
21297 __Pyx_XDECREF(__pyx_r);
21298 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
21299 __Pyx_GOTREF(__pyx_t_1);
21300 __pyx_r = __pyx_t_1;
21314 __Pyx_XDECREF(__pyx_t_1);
21315 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
21318 __Pyx_XGIVEREF(__pyx_r);
21319 __Pyx_RefNannyFinishContext();
21331 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
21332 PyObject *__pyx_r = NULL;
21333 __Pyx_RefNannyDeclarations
21335 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
21344 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
21354 __Pyx_XDECREF(__pyx_r);
21355 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
21356 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
21376 __Pyx_XDECREF(__pyx_r);
21377 __Pyx_INCREF(__pyx_empty_tuple);
21378 __pyx_r = __pyx_empty_tuple;
21392 __Pyx_XGIVEREF(__pyx_r);
21393 __Pyx_RefNannyFinishContext();
21405 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
21406 __Pyx_RefNannyDeclarations
21407 __Pyx_RefNannySetupContext(
"set_array_base", 0);
21416 Py_INCREF(__pyx_v_base);
21425 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
21436 __Pyx_RefNannyFinishContext();
21447 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
21448 PyObject *__pyx_v_base;
21449 PyObject *__pyx_r = NULL;
21450 __Pyx_RefNannyDeclarations
21452 __Pyx_RefNannySetupContext(
"get_array_base", 0);
21461 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
21470 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
21480 __Pyx_XDECREF(__pyx_r);
21481 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21500 __Pyx_XDECREF(__pyx_r);
21501 __Pyx_INCREF(((PyObject *)__pyx_v_base));
21502 __pyx_r = ((PyObject *)__pyx_v_base);
21515 __Pyx_XGIVEREF(__pyx_r);
21516 __Pyx_RefNannyFinishContext();
21528 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
21530 __Pyx_RefNannyDeclarations
21531 PyObject *__pyx_t_1 = NULL;
21532 PyObject *__pyx_t_2 = NULL;
21533 PyObject *__pyx_t_3 = NULL;
21535 PyObject *__pyx_t_5 = NULL;
21536 PyObject *__pyx_t_6 = NULL;
21537 PyObject *__pyx_t_7 = NULL;
21538 PyObject *__pyx_t_8 = NULL;
21539 int __pyx_lineno = 0;
21540 const char *__pyx_filename = NULL;
21541 int __pyx_clineno = 0;
21542 __Pyx_RefNannySetupContext(
"import_array", 0);
21552 __Pyx_PyThreadState_declare
21553 __Pyx_PyThreadState_assign
21554 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21555 __Pyx_XGOTREF(__pyx_t_1);
21556 __Pyx_XGOTREF(__pyx_t_2);
21557 __Pyx_XGOTREF(__pyx_t_3);
21567 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
21577 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21578 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21579 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21580 goto __pyx_L8_try_end;
21590 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
21592 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
21593 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
21594 __Pyx_GOTREF(__pyx_t_5);
21595 __Pyx_GOTREF(__pyx_t_6);
21596 __Pyx_GOTREF(__pyx_t_7);
21605 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
21606 __Pyx_GOTREF(__pyx_t_8);
21607 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21608 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21609 __PYX_ERR(1, 945, __pyx_L5_except_error)
21611 goto __pyx_L5_except_error;
21612 __pyx_L5_except_error:;
21621 __Pyx_XGIVEREF(__pyx_t_1);
21622 __Pyx_XGIVEREF(__pyx_t_2);
21623 __Pyx_XGIVEREF(__pyx_t_3);
21624 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21625 goto __pyx_L1_error;
21641 __Pyx_XDECREF(__pyx_t_5);
21642 __Pyx_XDECREF(__pyx_t_6);
21643 __Pyx_XDECREF(__pyx_t_7);
21644 __Pyx_XDECREF(__pyx_t_8);
21645 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
21648 __Pyx_RefNannyFinishContext();
21660 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
21662 __Pyx_RefNannyDeclarations
21663 PyObject *__pyx_t_1 = NULL;
21664 PyObject *__pyx_t_2 = NULL;
21665 PyObject *__pyx_t_3 = NULL;
21667 PyObject *__pyx_t_5 = NULL;
21668 PyObject *__pyx_t_6 = NULL;
21669 PyObject *__pyx_t_7 = NULL;
21670 PyObject *__pyx_t_8 = NULL;
21671 int __pyx_lineno = 0;
21672 const char *__pyx_filename = NULL;
21673 int __pyx_clineno = 0;
21674 __Pyx_RefNannySetupContext(
"import_umath", 0);
21684 __Pyx_PyThreadState_declare
21685 __Pyx_PyThreadState_assign
21686 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21687 __Pyx_XGOTREF(__pyx_t_1);
21688 __Pyx_XGOTREF(__pyx_t_2);
21689 __Pyx_XGOTREF(__pyx_t_3);
21699 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
21709 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21710 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21711 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21712 goto __pyx_L8_try_end;
21722 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
21724 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
21725 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
21726 __Pyx_GOTREF(__pyx_t_5);
21727 __Pyx_GOTREF(__pyx_t_6);
21728 __Pyx_GOTREF(__pyx_t_7);
21737 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
21738 __Pyx_GOTREF(__pyx_t_8);
21739 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21740 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21741 __PYX_ERR(1, 951, __pyx_L5_except_error)
21743 goto __pyx_L5_except_error;
21744 __pyx_L5_except_error:;
21753 __Pyx_XGIVEREF(__pyx_t_1);
21754 __Pyx_XGIVEREF(__pyx_t_2);
21755 __Pyx_XGIVEREF(__pyx_t_3);
21756 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21757 goto __pyx_L1_error;
21773 __Pyx_XDECREF(__pyx_t_5);
21774 __Pyx_XDECREF(__pyx_t_6);
21775 __Pyx_XDECREF(__pyx_t_7);
21776 __Pyx_XDECREF(__pyx_t_8);
21777 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
21780 __Pyx_RefNannyFinishContext();
21792 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
21794 __Pyx_RefNannyDeclarations
21795 PyObject *__pyx_t_1 = NULL;
21796 PyObject *__pyx_t_2 = NULL;
21797 PyObject *__pyx_t_3 = NULL;
21799 PyObject *__pyx_t_5 = NULL;
21800 PyObject *__pyx_t_6 = NULL;
21801 PyObject *__pyx_t_7 = NULL;
21802 PyObject *__pyx_t_8 = NULL;
21803 int __pyx_lineno = 0;
21804 const char *__pyx_filename = NULL;
21805 int __pyx_clineno = 0;
21806 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
21816 __Pyx_PyThreadState_declare
21817 __Pyx_PyThreadState_assign
21818 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21819 __Pyx_XGOTREF(__pyx_t_1);
21820 __Pyx_XGOTREF(__pyx_t_2);
21821 __Pyx_XGOTREF(__pyx_t_3);
21831 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
21841 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21842 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21843 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21844 goto __pyx_L8_try_end;
21854 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
21856 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21857 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
21858 __Pyx_GOTREF(__pyx_t_5);
21859 __Pyx_GOTREF(__pyx_t_6);
21860 __Pyx_GOTREF(__pyx_t_7);
21869 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
21870 __Pyx_GOTREF(__pyx_t_8);
21871 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21872 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21873 __PYX_ERR(1, 957, __pyx_L5_except_error)
21875 goto __pyx_L5_except_error;
21876 __pyx_L5_except_error:;
21885 __Pyx_XGIVEREF(__pyx_t_1);
21886 __Pyx_XGIVEREF(__pyx_t_2);
21887 __Pyx_XGIVEREF(__pyx_t_3);
21888 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21889 goto __pyx_L1_error;
21905 __Pyx_XDECREF(__pyx_t_5);
21906 __Pyx_XDECREF(__pyx_t_6);
21907 __Pyx_XDECREF(__pyx_t_7);
21908 __Pyx_XDECREF(__pyx_t_8);
21909 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21912 __Pyx_RefNannyFinishContext();
21924 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
21926 __Pyx_RefNannyDeclarations
21927 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
21936 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
21949 __Pyx_RefNannyFinishContext();
21961 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
21963 __Pyx_RefNannyDeclarations
21964 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
21973 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
21986 __Pyx_RefNannyFinishContext();
21998 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
21999 npy_datetime __pyx_r;
22008 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
22032 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
22033 npy_timedelta __pyx_r;
22042 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
22066 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
22067 NPY_DATETIMEUNIT __pyx_r;
22074 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
22090 static PyMethodDef __pyx_methods[] = {
22094 #if PY_MAJOR_VERSION >= 3
22095 #if CYTHON_PEP489_MULTI_PHASE_INIT
22096 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22097 static int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject* module);
22098 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22099 {Py_mod_create, (
void*)__pyx_pymod_create},
22100 {Py_mod_exec, (
void*)__pyx_pymod_exec_subsurfaceTransportFunctions},
22105 static struct PyModuleDef __pyx_moduledef = {
22106 PyModuleDef_HEAD_INIT,
22107 "subsurfaceTransportFunctions",
22109 #if CYTHON_PEP489_MULTI_PHASE_INIT
22115 #if CYTHON_PEP489_MULTI_PHASE_INIT
22116 __pyx_moduledef_slots,
22125 #ifndef CYTHON_SMALL_CODE
22126 #if defined(__clang__)
22127 #define CYTHON_SMALL_CODE
22128 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22129 #define CYTHON_SMALL_CODE __attribute__((cold))
22131 #define CYTHON_SMALL_CODE
22135 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22136 {&__pyx_n_s_DKWr_DpsiC, __pyx_k_DKWr_DpsiC,
sizeof(__pyx_k_DKWr_DpsiC), 0, 0, 1, 1},
22137 {&__pyx_n_s_DsBar_DpsiC, __pyx_k_DsBar_DpsiC,
sizeof(__pyx_k_DsBar_DpsiC), 0, 0, 1, 1},
22138 {&__pyx_n_s_DthetaW_DpsiC, __pyx_k_DthetaW_DpsiC,
sizeof(__pyx_k_DthetaW_DpsiC), 0, 0, 1, 1},
22139 {&__pyx_n_s_DvBar_DpsiC, __pyx_k_DvBar_DpsiC,
sizeof(__pyx_k_DvBar_DpsiC), 0, 0, 1, 1},
22140 {&__pyx_n_s_I, __pyx_k_I,
sizeof(__pyx_k_I), 0, 0, 1, 1},
22141 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22142 {&__pyx_n_s_J, __pyx_k_J,
sizeof(__pyx_k_J), 0, 0, 1, 1},
22143 {&__pyx_n_s_KWr, __pyx_k_KWr,
sizeof(__pyx_k_KWr), 0, 0, 1, 1},
22144 {&__pyx_n_s_KWs, __pyx_k_KWs,
sizeof(__pyx_k_KWs), 0, 0, 1, 1},
22145 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_k_RE_NCP1_evaluateElementCoefficie,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie), 0, 0, 1, 1},
22146 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_k_RE_NCP1_evaluateElementCoefficie_2,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie_2), 0, 0, 1, 1},
22147 {&__pyx_n_s_RE_NCP1_getElementJacobian, __pyx_k_RE_NCP1_getElementJacobian,
sizeof(__pyx_k_RE_NCP1_getElementJacobian), 0, 0, 1, 1},
22148 {&__pyx_n_s_RE_NCP1_getElementResidual, __pyx_k_RE_NCP1_getElementResidual,
sizeof(__pyx_k_RE_NCP1_getElementResidual), 0, 0, 1, 1},
22149 {&__pyx_n_s_a_avg, __pyx_k_a_avg,
sizeof(__pyx_k_a_avg), 0, 0, 1, 1},
22150 {&__pyx_n_s_a_eN, __pyx_k_a_eN,
sizeof(__pyx_k_a_eN), 0, 0, 1, 1},
22151 {&__pyx_n_s_a_neig, __pyx_k_a_neig,
sizeof(__pyx_k_a_neig), 0, 0, 1, 1},
22152 {&__pyx_n_s_a_up, __pyx_k_a_up,
sizeof(__pyx_k_a_up), 0, 0, 1, 1},
22153 {&__pyx_n_s_alpha, __pyx_k_alpha,
sizeof(__pyx_k_alpha), 0, 0, 1, 1},
22154 {&__pyx_n_s_beta, __pyx_k_beta,
sizeof(__pyx_k_beta), 0, 0, 1, 1},
22155 {&__pyx_n_s_calculateNormalFlux, __pyx_k_calculateNormalFlux,
sizeof(__pyx_k_calculateNormalFlux), 0, 0, 1, 1},
22156 {&__pyx_n_s_characteristic_velocity, __pyx_k_characteristic_velocity,
sizeof(__pyx_k_characteristic_velocity), 0, 0, 1, 1},
22157 {&__pyx_n_s_characteristic_velocity_dofs, __pyx_k_characteristic_velocity_dofs,
sizeof(__pyx_k_characteristic_velocity_dofs), 0, 0, 1, 1},
22158 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22159 {&__pyx_n_s_clock, __pyx_k_clock,
sizeof(__pyx_k_clock), 0, 0, 1, 1},
22160 {&__pyx_n_s_colind, __pyx_k_colind,
sizeof(__pyx_k_colind), 0, 0, 1, 1},
22161 {&__pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_k_computeSimpleCharacteristicVeloc,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc), 0, 0, 1, 1},
22162 {&__pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_k_computeSimpleCharacteristicVeloc_2,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc_2), 0, 0, 1, 1},
22163 {&__pyx_n_s_d, __pyx_k_d,
sizeof(__pyx_k_d), 0, 0, 1, 1},
22164 {&__pyx_n_s_dS, __pyx_k_dS,
sizeof(__pyx_k_dS), 0, 0, 1, 1},
22165 {&__pyx_n_s_dV, __pyx_k_dV,
sizeof(__pyx_k_dV), 0, 0, 1, 1},
22166 {&__pyx_n_s_denom, __pyx_k_denom,
sizeof(__pyx_k_denom), 0, 0, 1, 1},
22167 {&__pyx_n_s_df, __pyx_k_df,
sizeof(__pyx_k_df), 0, 0, 1, 1},
22168 {&__pyx_n_s_df_dofs, __pyx_k_df_dofs,
sizeof(__pyx_k_df_dofs), 0, 0, 1, 1},
22169 {&__pyx_n_s_dkr_up, __pyx_k_dkr_up,
sizeof(__pyx_k_dkr_up), 0, 0, 1, 1},
22170 {&__pyx_n_s_dm, __pyx_k_dm,
sizeof(__pyx_k_dm), 0, 0, 1, 1},
22171 {&__pyx_n_s_dmt, __pyx_k_dmt,
sizeof(__pyx_k_dmt), 0, 0, 1, 1},
22172 {&__pyx_n_s_dmtj_avg, __pyx_k_dmtj_avg,
sizeof(__pyx_k_dmtj_avg), 0, 0, 1, 1},
22173 {&__pyx_n_s_dot, __pyx_k_dot,
sizeof(__pyx_k_dot), 0, 0, 1, 1},
22174 {&__pyx_n_s_drhom, __pyx_k_drhom,
sizeof(__pyx_k_drhom), 0, 0, 1, 1},
22175 {&__pyx_n_s_eN, __pyx_k_eN,
sizeof(__pyx_k_eN), 0, 0, 1, 1},
22176 {&__pyx_n_s_eN_left, __pyx_k_eN_left,
sizeof(__pyx_k_eN_left), 0, 0, 1, 1},
22177 {&__pyx_n_s_eN_neighbor, __pyx_k_eN_neighbor,
sizeof(__pyx_k_eN_neighbor), 0, 0, 1, 1},
22178 {&__pyx_n_s_eN_right, __pyx_k_eN_right,
sizeof(__pyx_k_eN_right), 0, 0, 1, 1},
22179 {&__pyx_n_s_ebN, __pyx_k_ebN,
sizeof(__pyx_k_ebN), 0, 0, 1, 1},
22180 {&__pyx_n_s_ebNE, __pyx_k_ebNE,
sizeof(__pyx_k_ebNE), 0, 0, 1, 1},
22181 {&__pyx_n_s_ebN_local, __pyx_k_ebN_local,
sizeof(__pyx_k_ebN_local), 0, 0, 1, 1},
22182 {&__pyx_n_s_ebq_global_vals, __pyx_k_ebq_global_vals,
sizeof(__pyx_k_ebq_global_vals), 0, 0, 1, 1},
22183 {&__pyx_n_s_ebq_vals, __pyx_k_ebq_vals,
sizeof(__pyx_k_ebq_vals), 0, 0, 1, 1},
22184 {&__pyx_n_s_elementBarycentersArray, __pyx_k_elementBarycentersArray,
sizeof(__pyx_k_elementBarycentersArray), 0, 0, 1, 1},
22185 {&__pyx_n_s_elementBoundariesArray, __pyx_k_elementBoundariesArray,
sizeof(__pyx_k_elementBoundariesArray), 0, 0, 1, 1},
22186 {&__pyx_n_s_elementBoundaryElementsArray, __pyx_k_elementBoundaryElementsArray,
sizeof(__pyx_k_elementBoundaryElementsArray), 0, 0, 1, 1},
22187 {&__pyx_n_s_elementBoundaryMaterialTypes, __pyx_k_elementBoundaryMaterialTypes,
sizeof(__pyx_k_elementBoundaryMaterialTypes), 0, 0, 1, 1},
22188 {&__pyx_n_s_elementBoundaryTypes, __pyx_k_elementBoundaryTypes,
sizeof(__pyx_k_elementBoundaryTypes), 0, 0, 1, 1},
22189 {&__pyx_n_s_elementJacobian, __pyx_k_elementJacobian,
sizeof(__pyx_k_elementJacobian), 0, 0, 1, 1},
22190 {&__pyx_n_s_elementMaterialTypes, __pyx_k_elementMaterialTypes,
sizeof(__pyx_k_elementMaterialTypes), 0, 0, 1, 1},
22191 {&__pyx_n_s_elementNeighborsArray, __pyx_k_elementNeighborsArray,
sizeof(__pyx_k_elementNeighborsArray), 0, 0, 1, 1},
22192 {&__pyx_n_s_elementResidual, __pyx_k_elementResidual,
sizeof(__pyx_k_elementResidual), 0, 0, 1, 1},
22193 {&__pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_k_evaluateScalarMaterialFunctionOv,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv), 0, 0, 1, 1},
22194 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_k_evaluateScalarMaterialFunctionOv_2,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_2), 0, 0, 1, 1},
22195 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_k_evaluateScalarMaterialFunctionOv_3,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_3), 0, 0, 1, 1},
22196 {&__pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_k_evaluateSparseTensorMaterialFunc,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc), 0, 0, 1, 1},
22197 {&__pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_k_evaluateSparseTensorMaterialFunc_2,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc_2), 0, 0, 1, 1},
22198 {&__pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_k_evaluateVectorMaterialFunctionOv,
sizeof(__pyx_k_evaluateVectorMaterialFunctionOv), 0, 0, 1, 1},
22199 {&__pyx_n_s_exteriorElementBoundariesArray, __pyx_k_exteriorElementBoundariesArray,
sizeof(__pyx_k_exteriorElementBoundariesArray), 0, 0, 1, 1},
22200 {&__pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_k_exteriorElementBoundaryMaterialT,
sizeof(__pyx_k_exteriorElementBoundaryMaterialT), 0, 0, 1, 1},
22201 {&__pyx_n_s_f_up, __pyx_k_f_up,
sizeof(__pyx_k_f_up), 0, 0, 1, 1},
22202 {&__pyx_n_s_flat, __pyx_k_flat,
sizeof(__pyx_k_flat), 0, 0, 1, 1},
22203 {&__pyx_n_s_flux, __pyx_k_flux,
sizeof(__pyx_k_flux), 0, 0, 1, 1},
22204 {&__pyx_n_s_gravity, __pyx_k_gravity,
sizeof(__pyx_k_gravity), 0, 0, 1, 1},
22205 {&__pyx_n_s_helicalElementVelocityEval3, __pyx_k_helicalElementVelocityEval3,
sizeof(__pyx_k_helicalElementVelocityEval3), 0, 0, 1, 1},
22206 {&__pyx_n_s_helicalElementVelocityEval4, __pyx_k_helicalElementVelocityEval4,
sizeof(__pyx_k_helicalElementVelocityEval4), 0, 0, 1, 1},
22207 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
22208 {&__pyx_n_s_ii, __pyx_k_ii,
sizeof(__pyx_k_ii), 0, 0, 1, 1},
22209 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22210 {&__pyx_n_s_integral, __pyx_k_integral,
sizeof(__pyx_k_integral), 0, 0, 1, 1},
22211 {&__pyx_n_s_j, __pyx_k_j,
sizeof(__pyx_k_j), 0, 0, 1, 1},
22212 {&__pyx_n_s_jacobian_weak_residual, __pyx_k_jacobian_weak_residual,
sizeof(__pyx_k_jacobian_weak_residual), 0, 0, 1, 1},
22213 {&__pyx_n_s_k, __pyx_k_k,
sizeof(__pyx_k_k), 0, 0, 1, 1},
22214 {&__pyx_n_s_kb, __pyx_k_kb,
sizeof(__pyx_k_kb), 0, 0, 1, 1},
22215 {&__pyx_n_s_kr_eN, __pyx_k_kr_eN,
sizeof(__pyx_k_kr_eN), 0, 0, 1, 1},
22216 {&__pyx_n_s_kr_neig, __pyx_k_kr_neig,
sizeof(__pyx_k_kr_neig), 0, 0, 1, 1},
22217 {&__pyx_n_s_l2g, __pyx_k_l2g,
sizeof(__pyx_k_l2g), 0, 0, 1, 1},
22218 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
22219 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22220 {&__pyx_n_s_matID, __pyx_k_matID,
sizeof(__pyx_k_matID), 0, 0, 1, 1},
22221 {&__pyx_n_s_matID_neig, __pyx_k_matID_neig,
sizeof(__pyx_k_matID_neig), 0, 0, 1, 1},
22222 {&__pyx_n_s_material, __pyx_k_material,
sizeof(__pyx_k_material), 0, 0, 1, 1},
22223 {&__pyx_n_s_material_functions, __pyx_k_material_functions,
sizeof(__pyx_k_material_functions), 0, 0, 1, 1},
22224 {&__pyx_n_s_material_left, __pyx_k_material_left,
sizeof(__pyx_k_material_left), 0, 0, 1, 1},
22225 {&__pyx_n_s_material_right, __pyx_k_material_right,
sizeof(__pyx_k_material_right), 0, 0, 1, 1},
22226 {&__pyx_n_s_mt, __pyx_k_mt,
sizeof(__pyx_k_mt), 0, 0, 1, 1},
22227 {&__pyx_n_s_mt_avg, __pyx_k_mt_avg,
sizeof(__pyx_k_mt_avg), 0, 0, 1, 1},
22228 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
22229 {&__pyx_n_s_nAvgWeight, __pyx_k_nAvgWeight,
sizeof(__pyx_k_nAvgWeight), 0, 0, 1, 1},
22230 {&__pyx_n_s_nDOF_test_element, __pyx_k_nDOF_test_element,
sizeof(__pyx_k_nDOF_test_element), 0, 0, 1, 1},
22231 {&__pyx_n_s_nDOF_trial_element, __pyx_k_nDOF_trial_element,
sizeof(__pyx_k_nDOF_trial_element), 0, 0, 1, 1},
22232 {&__pyx_n_s_nElementBoundaries_element, __pyx_k_nElementBoundaries_element,
sizeof(__pyx_k_nElementBoundaries_element), 0, 0, 1, 1},
22233 {&__pyx_n_s_nElementBoundaries_global, __pyx_k_nElementBoundaries_global,
sizeof(__pyx_k_nElementBoundaries_global), 0, 0, 1, 1},
22234 {&__pyx_n_s_nElements_global, __pyx_k_nElements_global,
sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
22235 {&__pyx_n_s_nExteriorElementBoundaries_globa, __pyx_k_nExteriorElementBoundaries_globa,
sizeof(__pyx_k_nExteriorElementBoundaries_globa), 0, 0, 1, 1},
22236 {&__pyx_n_s_nSpace, __pyx_k_nSpace,
sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
22237 {&__pyx_n_s_nSpace2, __pyx_k_nSpace2,
sizeof(__pyx_k_nSpace2), 0, 0, 1, 1},
22238 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22239 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
22240 {&__pyx_n_s_nnz, __pyx_k_nnz,
sizeof(__pyx_k_nnz), 0, 0, 1, 1},
22241 {&__pyx_n_s_numer, __pyx_k_numer,
sizeof(__pyx_k_numer), 0, 0, 1, 1},
22242 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22243 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22244 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22245 {&__pyx_n_s_omega_e, __pyx_k_omega_e,
sizeof(__pyx_k_omega_e), 0, 0, 1, 1},
22246 {&__pyx_n_s_one8, __pyx_k_one8,
sizeof(__pyx_k_one8), 0, 0, 1, 1},
22247 {&__pyx_n_s_onePlus_pcBar_n, __pyx_k_onePlus_pcBar_n,
sizeof(__pyx_k_onePlus_pcBar_n), 0, 0, 1, 1},
22248 {&__pyx_n_s_pcBar, __pyx_k_pcBar,
sizeof(__pyx_k_pcBar), 0, 0, 1, 1},
22249 {&__pyx_n_s_pcBar_n, __pyx_k_pcBar_n,
sizeof(__pyx_k_pcBar_n), 0, 0, 1, 1},
22250 {&__pyx_n_s_pcBar_nM1, __pyx_k_pcBar_nM1,
sizeof(__pyx_k_pcBar_nM1), 0, 0, 1, 1},
22251 {&__pyx_n_s_pcBar_nM2, __pyx_k_pcBar_nM2,
sizeof(__pyx_k_pcBar_nM2), 0, 0, 1, 1},
22252 {&__pyx_n_s_phi_eN, __pyx_k_phi_eN,
sizeof(__pyx_k_phi_eN), 0, 0, 1, 1},
22253 {&__pyx_n_s_phi_neig, __pyx_k_phi_neig,
sizeof(__pyx_k_phi_neig), 0, 0, 1, 1},
22254 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
22255 {&__pyx_n_s_picard, __pyx_k_picard,
sizeof(__pyx_k_picard), 0, 0, 1, 1},
22256 {&__pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_k_proteus_subsurfaceTransportFunct,
sizeof(__pyx_k_proteus_subsurfaceTransportFunct), 0, 0, 1, 0},
22257 {&__pyx_n_s_psiC, __pyx_k_psiC,
sizeof(__pyx_k_psiC), 0, 0, 1, 1},
22258 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
22259 {&__pyx_n_s_q_alin, __pyx_k_q_alin,
sizeof(__pyx_k_q_alin), 0, 0, 1, 1},
22260 {&__pyx_n_s_q_detJ, __pyx_k_q_detJ,
sizeof(__pyx_k_q_detJ), 0, 0, 1, 1},
22261 {&__pyx_n_s_q_dkr, __pyx_k_q_dkr,
sizeof(__pyx_k_q_dkr), 0, 0, 1, 1},
22262 {&__pyx_n_s_q_dm, __pyx_k_q_dm,
sizeof(__pyx_k_q_dm), 0, 0, 1, 1},
22263 {&__pyx_n_s_q_dmass, __pyx_k_q_dmass,
sizeof(__pyx_k_q_dmass), 0, 0, 1, 1},
22264 {&__pyx_n_s_q_dmt, __pyx_k_q_dmt,
sizeof(__pyx_k_q_dmt), 0, 0, 1, 1},
22265 {&__pyx_n_s_q_flin, __pyx_k_q_flin,
sizeof(__pyx_k_q_flin), 0, 0, 1, 1},
22266 {&__pyx_n_s_q_grad_u, __pyx_k_q_grad_u,
sizeof(__pyx_k_q_grad_u), 0, 0, 1, 1},
22267 {&__pyx_n_s_q_grad_v, __pyx_k_q_grad_v,
sizeof(__pyx_k_q_grad_v), 0, 0, 1, 1},
22268 {&__pyx_n_s_q_grad_w, __pyx_k_q_grad_w,
sizeof(__pyx_k_q_grad_w), 0, 0, 1, 1},
22269 {&__pyx_n_s_q_kr, __pyx_k_q_kr,
sizeof(__pyx_k_q_kr), 0, 0, 1, 1},
22270 {&__pyx_n_s_q_kr_up, __pyx_k_q_kr_up,
sizeof(__pyx_k_q_kr_up), 0, 0, 1, 1},
22271 {&__pyx_n_s_q_m, __pyx_k_q_m,
sizeof(__pyx_k_q_m), 0, 0, 1, 1},
22272 {&__pyx_n_s_q_mass, __pyx_k_q_mass,
sizeof(__pyx_k_q_mass), 0, 0, 1, 1},
22273 {&__pyx_n_s_q_mt, __pyx_k_q_mt,
sizeof(__pyx_k_q_mt), 0, 0, 1, 1},
22274 {&__pyx_n_s_q_r, __pyx_k_q_r,
sizeof(__pyx_k_q_r), 0, 0, 1, 1},
22275 {&__pyx_n_s_q_u, __pyx_k_q_u,
sizeof(__pyx_k_q_u), 0, 0, 1, 1},
22276 {&__pyx_n_s_q_vals, __pyx_k_q_vals,
sizeof(__pyx_k_q_vals), 0, 0, 1, 1},
22277 {&__pyx_n_s_q_x, __pyx_k_q_x,
sizeof(__pyx_k_q_x), 0, 0, 1, 1},
22278 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22279 {&__pyx_n_s_rho, __pyx_k_rho,
sizeof(__pyx_k_rho), 0, 0, 1, 1},
22280 {&__pyx_n_s_rho2, __pyx_k_rho2,
sizeof(__pyx_k_rho2), 0, 0, 1, 1},
22281 {&__pyx_n_s_rhom, __pyx_k_rhom,
sizeof(__pyx_k_rhom), 0, 0, 1, 1},
22282 {&__pyx_n_s_rotatingGaussianElementVelocityE, __pyx_k_rotatingGaussianElementVelocityE,
sizeof(__pyx_k_rotatingGaussianElementVelocityE), 0, 0, 1, 1},
22283 {&__pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_k_rotatingGaussianElementVelocityE_2,
sizeof(__pyx_k_rotatingGaussianElementVelocityE_2), 0, 0, 1, 1},
22284 {&__pyx_n_s_rowptr, __pyx_k_rowptr,
sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
22285 {&__pyx_n_s_sBar, __pyx_k_sBar,
sizeof(__pyx_k_sBar), 0, 0, 1, 1},
22286 {&__pyx_n_s_setElementBoundariesArray, __pyx_k_setElementBoundariesArray,
sizeof(__pyx_k_setElementBoundariesArray), 0, 0, 1, 1},
22287 {&__pyx_n_s_setExteriorElementBoundaryTypes, __pyx_k_setExteriorElementBoundaryTypes,
sizeof(__pyx_k_setExteriorElementBoundaryTypes), 0, 0, 1, 1},
22288 {&__pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_k_setScalarMaterialFunctionOverEle,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle), 0, 0, 1, 1},
22289 {&__pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_k_setScalarMaterialFunctionOverEle_2,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle_2), 0, 0, 1, 1},
22290 {&__pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_k_setScalarMaterialFunctionOverGlo,
sizeof(__pyx_k_setScalarMaterialFunctionOverGlo), 0, 0, 1, 1},
22291 {&__pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_k_setSparseTensorMaterialFunctionO,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO), 0, 0, 1, 1},
22292 {&__pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_k_setSparseTensorMaterialFunctionO_2,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO_2), 0, 0, 1, 1},
22293 {&__pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_k_setVectorMaterialFunctionOverEle,
sizeof(__pyx_k_setVectorMaterialFunctionOverEle), 0, 0, 1, 1},
22294 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22295 {&__pyx_n_s_sqrt_sBar, __pyx_k_sqrt_sBar,
sizeof(__pyx_k_sqrt_sBar), 0, 0, 1, 1},
22296 {&__pyx_n_s_subsurfaceTransportFunctions, __pyx_k_subsurfaceTransportFunctions,
sizeof(__pyx_k_subsurfaceTransportFunctions), 0, 0, 1, 1},
22297 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
22298 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
22299 {&__pyx_n_s_tForReversal, __pyx_k_tForReversal,
sizeof(__pyx_k_tForReversal), 0, 0, 1, 1},
22300 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22301 {&__pyx_n_s_thetaR, __pyx_k_thetaR,
sizeof(__pyx_k_thetaR), 0, 0, 1, 1},
22302 {&__pyx_n_s_thetaS, __pyx_k_thetaS,
sizeof(__pyx_k_thetaS), 0, 0, 1, 1},
22303 {&__pyx_n_s_thetaSR, __pyx_k_thetaSR,
sizeof(__pyx_k_thetaSR), 0, 0, 1, 1},
22304 {&__pyx_n_s_thetaW, __pyx_k_thetaW,
sizeof(__pyx_k_thetaW), 0, 0, 1, 1},
22305 {&__pyx_n_s_thisElementIsUpwind, __pyx_k_thisElementIsUpwind,
sizeof(__pyx_k_thisElementIsUpwind), 0, 0, 1, 1},
22306 {&__pyx_n_s_transient, __pyx_k_transient,
sizeof(__pyx_k_transient), 0, 0, 1, 1},
22307 {&__pyx_n_s_u_dof, __pyx_k_u_dof,
sizeof(__pyx_k_u_dof), 0, 0, 1, 1},
22308 {&__pyx_n_s_u_eN, __pyx_k_u_eN,
sizeof(__pyx_k_u_eN), 0, 0, 1, 1},
22309 {&__pyx_n_s_u_j, __pyx_k_u_j,
sizeof(__pyx_k_u_j), 0, 0, 1, 1},
22310 {&__pyx_n_s_u_l2g, __pyx_k_u_l2g,
sizeof(__pyx_k_u_l2g), 0, 0, 1, 1},
22311 {&__pyx_n_s_u_neig, __pyx_k_u_neig,
sizeof(__pyx_k_u_neig), 0, 0, 1, 1},
22312 {&__pyx_n_s_updateMassJacobian_weakAvg, __pyx_k_updateMassJacobian_weakAvg,
sizeof(__pyx_k_updateMassJacobian_weakAvg), 0, 0, 1, 1},
22313 {&__pyx_n_s_updateMass_weakAvg, __pyx_k_updateMass_weakAvg,
sizeof(__pyx_k_updateMass_weakAvg), 0, 0, 1, 1},
22314 {&__pyx_n_s_upwindFlag, __pyx_k_upwindFlag,
sizeof(__pyx_k_upwindFlag), 0, 0, 1, 1},
22315 {&__pyx_n_s_v, __pyx_k_v,
sizeof(__pyx_k_v), 0, 0, 1, 1},
22316 {&__pyx_n_s_vBar, __pyx_k_vBar,
sizeof(__pyx_k_vBar), 0, 0, 1, 1},
22317 {&__pyx_n_s_vBar2, __pyx_k_vBar2,
sizeof(__pyx_k_vBar2), 0, 0, 1, 1},
22318 {&__pyx_n_s_vol, __pyx_k_vol,
sizeof(__pyx_k_vol), 0, 0, 1, 1},
22319 {&__pyx_n_s_volFactor, __pyx_k_volFactor,
sizeof(__pyx_k_volFactor), 0, 0, 1, 1},
22320 {&__pyx_n_s_vol_e, __pyx_k_vol_e,
sizeof(__pyx_k_vol_e), 0, 0, 1, 1},
22321 {&__pyx_n_s_volume, __pyx_k_volume,
sizeof(__pyx_k_volume), 0, 0, 1, 1},
22322 {&__pyx_n_s_vortexElementVelocityEval3, __pyx_k_vortexElementVelocityEval3,
sizeof(__pyx_k_vortexElementVelocityEval3), 0, 0, 1, 1},
22323 {&__pyx_n_s_vortexElementVelocityEval4, __pyx_k_vortexElementVelocityEval4,
sizeof(__pyx_k_vortexElementVelocityEval4), 0, 0, 1, 1},
22324 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
22325 {&__pyx_n_s_weak_residual, __pyx_k_weak_residual,
sizeof(__pyx_k_weak_residual), 0, 0, 1, 1},
22326 {&__pyx_n_s_weight, __pyx_k_weight,
sizeof(__pyx_k_weight), 0, 0, 1, 1},
22327 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
22328 {&__pyx_n_s_xc, __pyx_k_xc,
sizeof(__pyx_k_xc), 0, 0, 1, 1},
22329 {&__pyx_n_s_yc, __pyx_k_yc,
sizeof(__pyx_k_yc), 0, 0, 1, 1},
22330 {&__pyx_n_s_zVelocity, __pyx_k_zVelocity,
sizeof(__pyx_k_zVelocity), 0, 0, 1, 1},
22331 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
22332 {&__pyx_n_s_zvelocity, __pyx_k_zvelocity,
sizeof(__pyx_k_zvelocity), 0, 0, 1, 1},
22333 {0, 0, 0, 0, 0, 0, 0}
22335 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
22336 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 24, __pyx_L1_error)
22337 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
22343 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
22344 __Pyx_RefNannyDeclarations
22345 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22354 __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 66, __pyx_L1_error)
22355 __Pyx_GOTREF(__pyx_slice_);
22356 __Pyx_GIVEREF(__pyx_slice_);
22365 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 945, __pyx_L1_error)
22366 __Pyx_GOTREF(__pyx_tuple__2);
22367 __Pyx_GIVEREF(__pyx_tuple__2);
22376 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 951, __pyx_L1_error)
22377 __Pyx_GOTREF(__pyx_tuple__3);
22378 __Pyx_GIVEREF(__pyx_tuple__3);
22387 __pyx_tuple__4 = PyTuple_Pack(8, __pyx_n_s_nExteriorElementBoundaries_globa, __pyx_n_s_exteriorElementBoundariesArray, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_n_s_ebNE, __pyx_n_s_ebN, __pyx_n_s_eN);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 18, __pyx_L1_error)
22388 __Pyx_GOTREF(__pyx_tuple__4);
22389 __Pyx_GIVEREF(__pyx_tuple__4);
22390 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setExteriorElementBoundaryTypes, 18, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 18, __pyx_L1_error)
22399 __pyx_tuple__6 = PyTuple_Pack(7, __pyx_n_s_nElementBoundaries_global, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_elementBoundaryMaterialTypes, __pyx_n_s_ebN, __pyx_n_s_eN_left, __pyx_n_s_eN_right);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 29, __pyx_L1_error)
22400 __Pyx_GOTREF(__pyx_tuple__6);
22401 __Pyx_GIVEREF(__pyx_tuple__6);
22402 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setElementBoundariesArray, 29, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 29, __pyx_L1_error)
22411 __pyx_tuple__8 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 43, __pyx_L1_error)
22412 __Pyx_GOTREF(__pyx_tuple__8);
22413 __Pyx_GIVEREF(__pyx_tuple__8);
22414 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverEle, 43, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 43, __pyx_L1_error)
22423 __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 56, __pyx_L1_error)
22424 __Pyx_GOTREF(__pyx_tuple__10);
22425 __Pyx_GIVEREF(__pyx_tuple__10);
22426 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setVectorMaterialFunctionOverEle, 56, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 56, __pyx_L1_error)
22435 __pyx_tuple__12 = PyTuple_Pack(10, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 69, __pyx_L1_error)
22436 __Pyx_GOTREF(__pyx_tuple__12);
22437 __Pyx_GIVEREF(__pyx_tuple__12);
22438 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverEle_2, 69, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 69, __pyx_L1_error)
22447 __pyx_tuple__14 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 91, __pyx_L1_error)
22448 __Pyx_GOTREF(__pyx_tuple__14);
22449 __Pyx_GIVEREF(__pyx_tuple__14);
22450 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setSparseTensorMaterialFunctionO, 91, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 91, __pyx_L1_error)
22459 __pyx_tuple__16 = PyTuple_Pack(8, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 118, __pyx_L1_error)
22460 __Pyx_GOTREF(__pyx_tuple__16);
22461 __Pyx_GIVEREF(__pyx_tuple__16);
22462 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverGlo, 118, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 118, __pyx_L1_error)
22471 __pyx_tuple__18 = PyTuple_Pack(13, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 139, __pyx_L1_error)
22472 __Pyx_GOTREF(__pyx_tuple__18);
22473 __Pyx_GIVEREF(__pyx_tuple__18);
22474 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setSparseTensorMaterialFunctionO_2, 139, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 139, __pyx_L1_error)
22483 __pyx_tuple__20 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 165, __pyx_L1_error)
22484 __Pyx_GOTREF(__pyx_tuple__20);
22485 __Pyx_GIVEREF(__pyx_tuple__20);
22486 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 165, __pyx_L1_error)
22495 __pyx_tuple__22 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 180, __pyx_L1_error)
22496 __Pyx_GOTREF(__pyx_tuple__22);
22497 __Pyx_GIVEREF(__pyx_tuple__22);
22498 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateVectorMaterialFunctionOv, 180, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 180, __pyx_L1_error)
22507 __pyx_tuple__24 = PyTuple_Pack(12, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 195, __pyx_L1_error)
22508 __Pyx_GOTREF(__pyx_tuple__24);
22509 __Pyx_GIVEREF(__pyx_tuple__24);
22510 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, 195, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 195, __pyx_L1_error)
22519 __pyx_tuple__26 = PyTuple_Pack(17, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 219, __pyx_L1_error)
22520 __Pyx_GOTREF(__pyx_tuple__26);
22521 __Pyx_GIVEREF(__pyx_tuple__26);
22522 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(7, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateSparseTensorMaterialFunc, 219, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 219, __pyx_L1_error)
22531 __pyx_tuple__28 = PyTuple_Pack(10, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 248, __pyx_L1_error)
22532 __Pyx_GOTREF(__pyx_tuple__28);
22533 __Pyx_GIVEREF(__pyx_tuple__28);
22534 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(6, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, 248, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 248, __pyx_L1_error)
22543 __pyx_tuple__30 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 271, __pyx_L1_error)
22544 __Pyx_GOTREF(__pyx_tuple__30);
22545 __Pyx_GIVEREF(__pyx_tuple__30);
22546 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, 271, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 271, __pyx_L1_error)
22555 __pyx_tuple__32 = PyTuple_Pack(24, __pyx_n_s_rho, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_KWs, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_ebN, __pyx_n_s_matID, __pyx_n_s_matID_neig, __pyx_n_s_nSpace2, __pyx_n_s_nnz, __pyx_n_s_a_eN, __pyx_n_s_a_neig, __pyx_n_s_a_avg);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 301, __pyx_L1_error)
22556 __Pyx_GOTREF(__pyx_tuple__32);
22557 __Pyx_GIVEREF(__pyx_tuple__32);
22558 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(12, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, 301, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 301, __pyx_L1_error)
22567 __pyx_tuple__34 = PyTuple_Pack(61, __pyx_n_s_rho, __pyx_n_s_beta, __pyx_n_s_gravity, __pyx_n_s_alpha, __pyx_n_s_n, __pyx_n_s_thetaR, __pyx_n_s_thetaSR, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_nDOF_trial_element, __pyx_n_s_u_l2g, __pyx_n_s_u_dof, __pyx_n_s_q_x, __pyx_n_s_q_u, __pyx_n_s_q_mass, __pyx_n_s_q_dmass, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q, __pyx_n_s_psiC, __pyx_n_s_pcBar, __pyx_n_s_pcBar_n, __pyx_n_s_pcBar_nM1, __pyx_n_s_pcBar_nM2, __pyx_n_s_onePlus_pcBar_n, __pyx_n_s_sBar, __pyx_n_s_sqrt_sBar, __pyx_n_s_DsBar_DpsiC, __pyx_n_s_thetaW, __pyx_n_s_DthetaW_DpsiC, __pyx_n_s_vBar, __pyx_n_s_vBar2, __pyx_n_s_DvBar_DpsiC, __pyx_n_s_KWr, __pyx_n_s_DKWr_DpsiC, __pyx_n_s_rho2, __pyx_n_s_thetaS, __pyx_n_s_rhom, __pyx_n_s_drhom, __pyx_n_s_m, __pyx_n_s_u_j, __pyx_n_s_u_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_eN, __pyx_n_s_kr_neig, __pyx_n_s_phi_eN, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ebN, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_j, __pyx_n_s_matID, __pyx_n_s_nAvgWeight);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 359, __pyx_L1_error)
22568 __Pyx_GOTREF(__pyx_tuple__34);
22569 __Pyx_GIVEREF(__pyx_tuple__34);
22570 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(24, 0, 61, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, 359, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 359, __pyx_L1_error)
22579 __pyx_tuple__36 = PyTuple_Pack(42, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_mt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementResidual, __pyx_n_s_upwindFlag, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_volume);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 486, __pyx_L1_error)
22580 __Pyx_GOTREF(__pyx_tuple__36);
22581 __Pyx_GIVEREF(__pyx_tuple__36);
22582 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(21, 0, 42, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_getElementResidual, 486, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 486, __pyx_L1_error)
22591 __pyx_tuple__38 = PyTuple_Pack(51, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_nDOF_trial_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_grad_v, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_dm, __pyx_n_s_q_mt, __pyx_n_s_q_dmt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementJacobian, __pyx_n_s_upwindFlag, __pyx_n_s_picard, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_dkr_up, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_thisElementIsUpwind, __pyx_n_s_volume, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_j);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 574, __pyx_L1_error)
22592 __Pyx_GOTREF(__pyx_tuple__38);
22593 __Pyx_GIVEREF(__pyx_tuple__38);
22594 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(26, 0, 51, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_getElementJacobian, 574, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 574, __pyx_L1_error)
22603 __pyx_tuple__40 = PyTuple_Pack(9, __pyx_n_s_mt, __pyx_n_s_w, __pyx_n_s_dV, __pyx_n_s_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_k, __pyx_n_s_mt_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 673, __pyx_L1_error)
22604 __Pyx_GOTREF(__pyx_tuple__40);
22605 __Pyx_GIVEREF(__pyx_tuple__40);
22606 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_updateMass_weakAvg, 673, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 673, __pyx_L1_error)
22615 __pyx_tuple__42 = PyTuple_Pack(11, __pyx_n_s_dmt, __pyx_n_s_w, __pyx_n_s_v, __pyx_n_s_dV, __pyx_n_s_jacobian_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_dmtj_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 692, __pyx_L1_error)
22616 __Pyx_GOTREF(__pyx_tuple__42);
22617 __Pyx_GIVEREF(__pyx_tuple__42);
22618 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_updateMassJacobian_weakAvg, 692, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 692, __pyx_L1_error)
22627 __pyx_tuple__44 = PyTuple_Pack(9, __pyx_n_s_v, __pyx_n_s_n, __pyx_n_s_dS, __pyx_n_s_flux, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_kb, __pyx_n_s_integral, __pyx_n_s_I);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 717, __pyx_L1_error)
22628 __Pyx_GOTREF(__pyx_tuple__44);
22629 __Pyx_GIVEREF(__pyx_tuple__44);
22630 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_calculateNormalFlux, 717, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 717, __pyx_L1_error)
22639 __pyx_tuple__46 = PyTuple_Pack(9, __pyx_n_s_df, __pyx_n_s_characteristic_velocity, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_I, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 732, __pyx_L1_error)
22640 __Pyx_GOTREF(__pyx_tuple__46);
22641 __Pyx_GIVEREF(__pyx_tuple__46);
22642 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_computeSimpleCharacteristicVeloc, 732, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 732, __pyx_L1_error)
22651 __pyx_tuple__48 = PyTuple_Pack(11, __pyx_n_s_df_dofs, __pyx_n_s_characteristic_velocity_dofs, __pyx_n_s_l2g, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_j, __pyx_n_s_J, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 753, __pyx_L1_error)
22652 __Pyx_GOTREF(__pyx_tuple__48);
22653 __Pyx_GIVEREF(__pyx_tuple__48);
22654 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_computeSimpleCharacteristicVeloc_2, 753, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 753, __pyx_L1_error)
22663 __pyx_tuple__50 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 776, __pyx_L1_error)
22664 __Pyx_GOTREF(__pyx_tuple__50);
22665 __Pyx_GIVEREF(__pyx_tuple__50);
22666 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_rotatingGaussianElementVelocityE, 776, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 776, __pyx_L1_error)
22675 __pyx_tuple__52 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 816, __pyx_L1_error)
22676 __Pyx_GOTREF(__pyx_tuple__52);
22677 __Pyx_GIVEREF(__pyx_tuple__52);
22678 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_rotatingGaussianElementVelocityE_2, 816, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 816, __pyx_L1_error)
22687 __pyx_tuple__54 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 859, __pyx_L1_error)
22688 __Pyx_GOTREF(__pyx_tuple__54);
22689 __Pyx_GIVEREF(__pyx_tuple__54);
22690 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_helicalElementVelocityEval3, 859, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 859, __pyx_L1_error)
22699 __pyx_tuple__56 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 884, __pyx_L1_error)
22700 __Pyx_GOTREF(__pyx_tuple__56);
22701 __Pyx_GIVEREF(__pyx_tuple__56);
22702 __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_helicalElementVelocityEval4, 884, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 884, __pyx_L1_error)
22711 __pyx_tuple__58 = PyTuple_Pack(7, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 911, __pyx_L1_error)
22712 __Pyx_GOTREF(__pyx_tuple__58);
22713 __Pyx_GIVEREF(__pyx_tuple__58);
22714 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_vortexElementVelocityEval3, 911, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 911, __pyx_L1_error)
22723 __pyx_tuple__60 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_ebN, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 924, __pyx_L1_error)
22724 __Pyx_GOTREF(__pyx_tuple__60);
22725 __Pyx_GIVEREF(__pyx_tuple__60);
22726 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_vortexElementVelocityEval4, 924, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 924, __pyx_L1_error)
22727 __Pyx_RefNannyFinishContext();
22730 __Pyx_RefNannyFinishContext();
22734 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
22735 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22736 __pyx_float_0_0 = PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22737 __pyx_float_0_5 = PyFloat_FromDouble(0.5);
if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
22738 __pyx_float_2_0 = PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22739 __pyx_float_1_0eneg_20 = PyFloat_FromDouble(1.0e-20);
if (unlikely(!__pyx_float_1_0eneg_20)) __PYX_ERR(0, 1, __pyx_L1_error)
22745 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
22746 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
22747 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
22748 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
22749 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
22750 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
22751 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
22753 static int __Pyx_modinit_global_init_code(
void) {
22754 __Pyx_RefNannyDeclarations
22755 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
22757 __Pyx_RefNannyFinishContext();
22761 static int __Pyx_modinit_variable_export_code(
void) {
22762 __Pyx_RefNannyDeclarations
22763 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
22765 __Pyx_RefNannyFinishContext();
22769 static int __Pyx_modinit_function_export_code(
void) {
22770 __Pyx_RefNannyDeclarations
22771 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
22773 __Pyx_RefNannyFinishContext();
22777 static int __Pyx_modinit_type_init_code(
void) {
22778 __Pyx_RefNannyDeclarations
22779 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
22781 __Pyx_RefNannyFinishContext();
22785 static int __Pyx_modinit_type_import_code(
void) {
22786 __Pyx_RefNannyDeclarations
22787 PyObject *__pyx_t_1 = NULL;
22788 int __pyx_lineno = 0;
22789 const char *__pyx_filename = NULL;
22790 int __pyx_clineno = 0;
22791 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
22793 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
22794 __Pyx_GOTREF(__pyx_t_1);
22795 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
22796 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
22797 sizeof(PyTypeObject),
22799 sizeof(PyHeapTypeObject),
22801 __Pyx_ImportType_CheckSize_Warn);
22802 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
22803 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22804 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
22805 __Pyx_GOTREF(__pyx_t_1);
22806 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
22807 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
22808 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
22809 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
22810 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
22811 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
22812 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
22813 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
22814 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22815 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
22816 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22817 if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
22818 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22819 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
22820 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22821 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
22822 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22823 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
22824 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22825 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
22826 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22827 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
22828 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22829 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
22830 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22831 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
22832 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22833 if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
22834 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
22835 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
22836 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22837 __Pyx_RefNannyFinishContext();
22840 __Pyx_XDECREF(__pyx_t_1);
22841 __Pyx_RefNannyFinishContext();
22845 static int __Pyx_modinit_variable_import_code(
void) {
22846 __Pyx_RefNannyDeclarations
22847 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
22849 __Pyx_RefNannyFinishContext();
22853 static int __Pyx_modinit_function_import_code(
void) {
22854 __Pyx_RefNannyDeclarations
22855 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
22857 __Pyx_RefNannyFinishContext();
22862 #ifndef CYTHON_NO_PYINIT_EXPORT
22863 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22864 #elif PY_MAJOR_VERSION < 3
22866 #define __Pyx_PyMODINIT_FUNC extern "C" void
22868 #define __Pyx_PyMODINIT_FUNC void
22872 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22874 #define __Pyx_PyMODINIT_FUNC PyObject *
22879 #if PY_MAJOR_VERSION < 3
22880 __Pyx_PyMODINIT_FUNC initsubsurfaceTransportFunctions(
void) CYTHON_SMALL_CODE;
22881 __Pyx_PyMODINIT_FUNC initsubsurfaceTransportFunctions(
void)
22883 __Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(
void) CYTHON_SMALL_CODE;
22884 __Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(
void)
22885 #if CYTHON_PEP489_MULTI_PHASE_INIT
22887 return PyModuleDef_Init(&__pyx_moduledef);
22889 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
22890 #if PY_VERSION_HEX >= 0x030700A1
22891 static PY_INT64_T main_interpreter_id = -1;
22892 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22893 if (main_interpreter_id == -1) {
22894 main_interpreter_id = current_id;
22895 return (unlikely(current_id == -1)) ? -1 : 0;
22896 }
else if (unlikely(main_interpreter_id != current_id))
22898 static PyInterpreterState *main_interpreter = NULL;
22899 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22900 if (!main_interpreter) {
22901 main_interpreter = current_interpreter;
22902 }
else if (unlikely(main_interpreter != current_interpreter))
22907 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22912 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
22913 PyObject *value = PyObject_GetAttrString(spec, from_name);
22915 if (likely(value)) {
22916 if (allow_none || value != Py_None) {
22917 result = PyDict_SetItemString(moddict, to_name, value);
22920 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22927 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22928 PyObject *module = NULL, *moddict, *modname;
22929 if (__Pyx_check_single_interpreter())
22932 return __Pyx_NewRef(__pyx_m);
22933 modname = PyObject_GetAttrString(spec,
"name");
22934 if (unlikely(!modname))
goto bad;
22935 module = PyModule_NewObject(modname);
22936 Py_DECREF(modname);
22937 if (unlikely(!module))
goto bad;
22938 moddict = PyModule_GetDict(module);
22939 if (unlikely(!moddict))
goto bad;
22940 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
22941 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
22942 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
22943 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
22946 Py_XDECREF(module);
22951 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject *__pyx_pyinit_module)
22955 PyObject *__pyx_t_1 = NULL;
22956 int __pyx_lineno = 0;
22957 const char *__pyx_filename = NULL;
22958 int __pyx_clineno = 0;
22959 __Pyx_RefNannyDeclarations
22960 #if CYTHON_PEP489_MULTI_PHASE_INIT
22962 if (__pyx_m == __pyx_pyinit_module)
return 0;
22963 PyErr_SetString(PyExc_RuntimeError,
"Module 'subsurfaceTransportFunctions' has already been imported. Re-initialisation is not supported.");
22966 #elif PY_MAJOR_VERSION >= 3
22967 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
22969 #if CYTHON_REFNANNY
22970 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
22971 if (!__Pyx_RefNanny) {
22973 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
22974 if (!__Pyx_RefNanny)
22975 Py_FatalError(
"failed to import 'refnanny' module");
22978 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(void)", 0);
22979 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22980 #ifdef __Pxy_PyFrame_Initialize_Offsets
22981 __Pxy_PyFrame_Initialize_Offsets();
22983 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22984 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22985 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22986 #ifdef __Pyx_CyFunction_USED
22987 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22989 #ifdef __Pyx_FusedFunction_USED
22990 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22992 #ifdef __Pyx_Coroutine_USED
22993 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22995 #ifdef __Pyx_Generator_USED
22996 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22998 #ifdef __Pyx_AsyncGen_USED
22999 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23001 #ifdef __Pyx_StopAsyncIteration_USED
23002 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23006 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23007 PyEval_InitThreads();
23010 #if CYTHON_PEP489_MULTI_PHASE_INIT
23011 __pyx_m = __pyx_pyinit_module;
23012 Py_INCREF(__pyx_m);
23014 #if PY_MAJOR_VERSION < 3
23015 __pyx_m = Py_InitModule4(
"subsurfaceTransportFunctions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23017 __pyx_m = PyModule_Create(&__pyx_moduledef);
23019 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23021 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23022 Py_INCREF(__pyx_d);
23023 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23024 Py_INCREF(__pyx_b);
23025 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23026 Py_INCREF(__pyx_cython_runtime);
23027 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23029 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23030 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23031 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23033 if (__pyx_module_is_main_subsurfaceTransportFunctions) {
23034 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23036 #if PY_MAJOR_VERSION >= 3
23038 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23039 if (!PyDict_GetItemString(modules,
"subsurfaceTransportFunctions")) {
23040 if (unlikely(PyDict_SetItemString(modules,
"subsurfaceTransportFunctions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23045 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23047 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23049 (void)__Pyx_modinit_global_init_code();
23050 (void)__Pyx_modinit_variable_export_code();
23051 (void)__Pyx_modinit_function_export_code();
23052 (void)__Pyx_modinit_type_init_code();
23053 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23054 (void)__Pyx_modinit_variable_import_code();
23055 (void)__Pyx_modinit_function_import_code();
23057 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23058 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23066 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23067 __Pyx_GOTREF(__pyx_t_1);
23068 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23069 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23078 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
23079 __Pyx_GOTREF(__pyx_t_1);
23080 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setExteriorElementBoundaryTypes, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
23081 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23090 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
23091 __Pyx_GOTREF(__pyx_t_1);
23092 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setElementBoundariesArray, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
23093 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23102 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
23103 __Pyx_GOTREF(__pyx_t_1);
23104 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
23105 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23114 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
23115 __Pyx_GOTREF(__pyx_t_1);
23116 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
23117 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23126 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
23127 __Pyx_GOTREF(__pyx_t_1);
23128 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_t_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
23129 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23138 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
23139 __Pyx_GOTREF(__pyx_t_1);
23140 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_t_1) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
23141 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23150 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
23151 __Pyx_GOTREF(__pyx_t_1);
23152 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_t_1) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
23153 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23162 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
23163 __Pyx_GOTREF(__pyx_t_1);
23164 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_t_1) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
23165 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23174 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
23175 __Pyx_GOTREF(__pyx_t_1);
23176 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
23177 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23186 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
23187 __Pyx_GOTREF(__pyx_t_1);
23188 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
23189 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23198 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
23199 __Pyx_GOTREF(__pyx_t_1);
23200 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_t_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
23201 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23210 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
23211 __Pyx_GOTREF(__pyx_t_1);
23212 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
23213 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23222 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
23223 __Pyx_GOTREF(__pyx_t_1);
23224 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_t_1) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
23225 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23234 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
23235 __Pyx_GOTREF(__pyx_t_1);
23236 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_t_1) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
23237 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23246 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
23247 __Pyx_GOTREF(__pyx_t_1);
23248 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_t_1) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
23249 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23258 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
23259 __Pyx_GOTREF(__pyx_t_1);
23260 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_t_1) < 0) __PYX_ERR(0, 359, __pyx_L1_error)
23261 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23270 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
23271 __Pyx_GOTREF(__pyx_t_1);
23272 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementResidual, __pyx_t_1) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
23273 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23282 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
23283 __Pyx_GOTREF(__pyx_t_1);
23284 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementJacobian, __pyx_t_1) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
23285 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23294 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
23295 __Pyx_GOTREF(__pyx_t_1);
23296 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMass_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
23297 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23306 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
23307 __Pyx_GOTREF(__pyx_t_1);
23308 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMassJacobian_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
23309 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23318 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
23319 __Pyx_GOTREF(__pyx_t_1);
23320 if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateNormalFlux, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
23321 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23330 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error)
23331 __Pyx_GOTREF(__pyx_t_1);
23332 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_t_1) < 0) __PYX_ERR(0, 732, __pyx_L1_error)
23333 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23342 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
23343 __Pyx_GOTREF(__pyx_t_1);
23344 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_t_1) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
23345 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23354 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
23355 __Pyx_GOTREF(__pyx_t_1);
23356 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE, __pyx_t_1) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
23357 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23366 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
23367 __Pyx_GOTREF(__pyx_t_1);
23368 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_t_1) < 0) __PYX_ERR(0, 816, __pyx_L1_error)
23369 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23378 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
23379 __Pyx_GOTREF(__pyx_t_1);
23380 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
23381 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23390 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
23391 __Pyx_GOTREF(__pyx_t_1);
23392 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
23393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23402 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
23403 __Pyx_GOTREF(__pyx_t_1);
23404 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
23405 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23414 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
23415 __Pyx_GOTREF(__pyx_t_1);
23416 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 924, __pyx_L1_error)
23417 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23424 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23425 __Pyx_GOTREF(__pyx_t_1);
23426 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23427 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23441 __Pyx_XDECREF(__pyx_t_1);
23444 __Pyx_AddTraceback(
"init subsurfaceTransportFunctions", __pyx_clineno, __pyx_lineno, __pyx_filename);
23447 }
else if (!PyErr_Occurred()) {
23448 PyErr_SetString(PyExc_ImportError,
"init subsurfaceTransportFunctions");
23451 __Pyx_RefNannyFinishContext();
23452 #if CYTHON_PEP489_MULTI_PHASE_INIT
23453 return (__pyx_m != NULL) ? 0 : -1;
23454 #elif PY_MAJOR_VERSION >= 3
23463 #if CYTHON_REFNANNY
23464 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23465 PyObject *m = NULL, *p = NULL;
23467 m = PyImport_ImportModule(modname);
23469 p = PyObject_GetAttrString(m,
"RefNannyAPI");
23471 r = PyLong_AsVoidPtr(p);
23475 return (__Pyx_RefNannyAPIStruct *)
r;
23480 #if CYTHON_USE_TYPE_SLOTS
23481 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23482 PyTypeObject* tp = Py_TYPE(obj);
23483 if (likely(tp->tp_getattro))
23484 return tp->tp_getattro(obj, attr_name);
23485 #if PY_MAJOR_VERSION < 3
23486 if (likely(tp->tp_getattr))
23487 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23489 return PyObject_GetAttr(obj, attr_name);
23494 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23495 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23496 if (unlikely(!result)) {
23497 PyErr_Format(PyExc_NameError,
23498 #
if PY_MAJOR_VERSION >= 3
23499 "name '%U' is not defined", name);
23501 "name '%.200s' is not defined", PyString_AS_STRING(name));
23508 static void __Pyx_RaiseArgtupleInvalid(
23509 const char* func_name,
23511 Py_ssize_t num_min,
23512 Py_ssize_t num_max,
23513 Py_ssize_t num_found)
23515 Py_ssize_t num_expected;
23516 const char *more_or_less;
23517 if (num_found < num_min) {
23518 num_expected = num_min;
23519 more_or_less =
"at least";
23521 num_expected = num_max;
23522 more_or_less =
"at most";
23525 more_or_less =
"exactly";
23527 PyErr_Format(PyExc_TypeError,
23528 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
23529 func_name, more_or_less, num_expected,
23530 (num_expected == 1) ?
"" :
"s", num_found);
23534 static void __Pyx_RaiseDoubleKeywordsError(
23535 const char* func_name,
23538 PyErr_Format(PyExc_TypeError,
23539 #
if PY_MAJOR_VERSION >= 3
23540 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23542 "%s() got multiple values for keyword argument '%s'", func_name,
23543 PyString_AsString(kw_name));
23548 static int __Pyx_ParseOptionalKeywords(
23550 PyObject **argnames[],
23552 PyObject *values[],
23553 Py_ssize_t num_pos_args,
23554 const char* function_name)
23556 PyObject *key = 0, *value = 0;
23557 Py_ssize_t
pos = 0;
23559 PyObject*** first_kw_arg = argnames + num_pos_args;
23560 while (PyDict_Next(kwds, &
pos, &key, &value)) {
23561 name = first_kw_arg;
23562 while (*name && (**name != key)) name++;
23564 values[name-argnames] = value;
23567 name = first_kw_arg;
23568 #if PY_MAJOR_VERSION < 3
23569 if (likely(PyString_Check(key))) {
23571 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23572 && _PyString_Eq(**name, key)) {
23573 values[name-argnames] = value;
23578 if (*name)
continue;
23580 PyObject*** argname = argnames;
23581 while (argname != first_kw_arg) {
23582 if ((**argname == key) || (
23583 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23584 && _PyString_Eq(**argname, key))) {
23585 goto arg_passed_twice;
23592 if (likely(PyUnicode_Check(key))) {
23594 int cmp = (**name == key) ? 0 :
23595 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23596 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23598 PyUnicode_Compare(**name, key);
23599 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23601 values[name-argnames] = value;
23606 if (*name)
continue;
23608 PyObject*** argname = argnames;
23609 while (argname != first_kw_arg) {
23610 int cmp = (**argname == key) ? 0 :
23611 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23612 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23614 PyUnicode_Compare(**argname, key);
23615 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23616 if (cmp == 0)
goto arg_passed_twice;
23621 goto invalid_keyword_type;
23623 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
23625 goto invalid_keyword;
23630 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23632 invalid_keyword_type:
23633 PyErr_Format(PyExc_TypeError,
23634 "%.200s() keywords must be strings", function_name);
23637 PyErr_Format(PyExc_TypeError,
23638 #
if PY_MAJOR_VERSION < 3
23639 "%.200s() got an unexpected keyword argument '%.200s'",
23640 function_name, PyString_AsString(key));
23642 "%s() got an unexpected keyword argument '%U'",
23643 function_name, key);
23650 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
23652 if (unlikely(!type)) {
23653 PyErr_SetString(PyExc_SystemError,
"Missing type object");
23657 #if PY_MAJOR_VERSION == 2
23658 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
23662 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
23664 PyErr_Format(PyExc_TypeError,
23665 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23666 name, type->tp_name, Py_TYPE(obj)->tp_name);
23671 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
23677 S.u32 = 0x01020304;
23678 return S.u8[0] == 4;
23682 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
23683 __Pyx_BufFmt_StackElem* stack,
23684 __Pyx_TypeInfo* type) {
23685 stack[0].field = &ctx->root;
23686 stack[0].parent_offset = 0;
23687 ctx->root.type = type;
23688 ctx->root.name =
"buffer dtype";
23689 ctx->root.offset = 0;
23691 ctx->head->field = &ctx->root;
23692 ctx->fmt_offset = 0;
23693 ctx->head->parent_offset = 0;
23694 ctx->new_packmode =
'@';
23695 ctx->enc_packmode =
'@';
23696 ctx->new_count = 1;
23697 ctx->enc_count = 0;
23699 ctx->is_complex = 0;
23700 ctx->is_valid_array = 0;
23701 ctx->struct_alignment = 0;
23702 while (type->typegroup ==
'S') {
23704 ctx->head->field = type->fields;
23705 ctx->head->parent_offset = 0;
23706 type = type->fields->type;
23709 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
23711 const char* t = *ts;
23712 if (*t < '0' || *t >
'9') {
23715 count = *t++ -
'0';
23716 while (*t >=
'0' && *t <=
'9') {
23718 count += *t++ -
'0';
23724 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
23725 int number = __Pyx_BufFmt_ParseNumber(ts);
23727 PyErr_Format(PyExc_ValueError,\
23728 "Does not understand character buffer dtype format string ('%c')", **ts);
23731 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
23732 PyErr_Format(PyExc_ValueError,
23733 "Unexpected format string character: '%c'", ch);
23735 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
23737 case '?':
return "'bool'";
23738 case 'c':
return "'char'";
23739 case 'b':
return "'signed char'";
23740 case 'B':
return "'unsigned char'";
23741 case 'h':
return "'short'";
23742 case 'H':
return "'unsigned short'";
23743 case 'i':
return "'int'";
23744 case 'I':
return "'unsigned int'";
23745 case 'l':
return "'long'";
23746 case 'L':
return "'unsigned long'";
23747 case 'q':
return "'long long'";
23748 case 'Q':
return "'unsigned long long'";
23749 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
23750 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
23751 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
23752 case 'T':
return "a struct";
23753 case 'O':
return "Python object";
23754 case 'P':
return "a pointer";
23755 case 's':
case 'p':
return "a string";
23756 case 0:
return "end";
23757 default:
return "unparseable format string";
23760 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
23762 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23763 case 'h':
case 'H':
return 2;
23764 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
23765 case 'q':
case 'Q':
return 8;
23766 case 'f':
return (is_complex ? 8 : 4);
23767 case 'd':
return (is_complex ? 16 : 8);
23769 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
23772 case 'O':
case 'P':
return sizeof(
void*);
23774 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23778 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
23780 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23781 case 'h':
case 'H':
return sizeof(short);
23782 case 'i':
case 'I':
return sizeof(int);
23783 case 'l':
case 'L':
return sizeof(long);
23784 #ifdef HAVE_LONG_LONG
23785 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
23787 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
23788 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
23789 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
23790 case 'O':
case 'P':
return sizeof(
void*);
23792 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23797 typedef struct {
char c;
short x; } __Pyx_st_short;
23798 typedef struct {
char c;
int x; } __Pyx_st_int;
23799 typedef struct {
char c;
long x; } __Pyx_st_long;
23800 typedef struct {
char c;
float x; } __Pyx_st_float;
23801 typedef struct {
char c;
double x; } __Pyx_st_double;
23802 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
23803 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
23804 #ifdef HAVE_LONG_LONG
23805 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
23807 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
23809 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23810 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
23811 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
23812 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
23813 #ifdef HAVE_LONG_LONG
23814 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
23816 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
23817 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
23818 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
23819 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
23821 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23829 typedef struct {
short x;
char c; } __Pyx_pad_short;
23830 typedef struct {
int x;
char c; } __Pyx_pad_int;
23831 typedef struct {
long x;
char c; } __Pyx_pad_long;
23832 typedef struct {
float x;
char c; } __Pyx_pad_float;
23833 typedef struct {
double x;
char c; } __Pyx_pad_double;
23834 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
23835 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
23836 #ifdef HAVE_LONG_LONG
23837 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
23839 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
23841 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23842 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
23843 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
23844 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
23845 #ifdef HAVE_LONG_LONG
23846 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
23848 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
23849 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
23850 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
23851 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
23853 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23857 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
23861 case 'b':
case 'h':
case 'i':
23862 case 'l':
case 'q':
case 's':
case 'p':
23864 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
23866 case 'f':
case 'd':
case 'g':
23867 return (is_complex ?
'C' :
'R');
23873 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23878 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
23879 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
23880 const char* expected;
23882 if (ctx->head == NULL) {
23886 expected = ctx->head->field->type->name;
23889 PyErr_Format(PyExc_ValueError,
23890 "Buffer dtype mismatch, expected %s%s%s but got %s",
23891 quote, expected, quote,
23892 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
23894 __Pyx_StructField* field = ctx->head->field;
23895 __Pyx_StructField* parent = (ctx->head - 1)->field;
23896 PyErr_Format(PyExc_ValueError,
23897 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
23898 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
23899 parent->type->name, field->name);
23902 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
23904 size_t size, offset, arraysize = 1;
23905 if (ctx->enc_type == 0)
return 0;
23906 if (ctx->head->field->type->arraysize[0]) {
23908 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
23909 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
23911 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
23912 PyErr_Format(PyExc_ValueError,
23913 "Expected a dimension of size %zu, got %zu",
23914 ctx->head->field->type->arraysize[0], ctx->enc_count);
23918 if (!ctx->is_valid_array) {
23919 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
23920 ctx->head->field->type->ndim, ndim);
23923 for (i = 0; i < ctx->head->field->type->ndim; i++) {
23924 arraysize *= ctx->head->field->type->arraysize[i];
23926 ctx->is_valid_array = 0;
23927 ctx->enc_count = 1;
23929 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
23931 __Pyx_StructField* field = ctx->head->field;
23932 __Pyx_TypeInfo* type = field->type;
23933 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
23934 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
23936 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
23938 if (ctx->enc_packmode ==
'@') {
23939 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
23940 size_t align_mod_offset;
23941 if (align_at == 0)
return -1;
23942 align_mod_offset = ctx->fmt_offset % align_at;
23943 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
23944 if (ctx->struct_alignment == 0)
23945 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
23948 if (type->size != size || type->typegroup != group) {
23949 if (type->typegroup ==
'C' && type->fields != NULL) {
23950 size_t parent_offset = ctx->head->parent_offset + field->offset;
23952 ctx->head->field = type->fields;
23953 ctx->head->parent_offset = parent_offset;
23956 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
23958 __Pyx_BufFmt_RaiseExpected(ctx);
23962 offset = ctx->head->parent_offset + field->offset;
23963 if (ctx->fmt_offset != offset) {
23964 PyErr_Format(PyExc_ValueError,
23965 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
23966 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
23969 ctx->fmt_offset += size;
23971 ctx->fmt_offset += (arraysize - 1) * size;
23974 if (field == &ctx->root) {
23976 if (ctx->enc_count != 0) {
23977 __Pyx_BufFmt_RaiseExpected(ctx);
23982 ctx->head->field = ++field;
23983 if (field->type == NULL) {
23985 field = ctx->head->field;
23987 }
else if (field->type->typegroup ==
'S') {
23988 size_t parent_offset = ctx->head->parent_offset + field->offset;
23989 if (field->type->fields->type == NULL)
continue;
23990 field = field->type->fields;
23992 ctx->head->field = field;
23993 ctx->head->parent_offset = parent_offset;
23999 }
while (ctx->enc_count);
24001 ctx->is_complex = 0;
24005 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
24007 const char *ts = *tsp;
24008 int i = 0,
number, ndim;
24010 if (ctx->new_count != 1) {
24011 PyErr_SetString(PyExc_ValueError,
24012 "Cannot handle repeated arrays in format string");
24015 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24016 ndim = ctx->head->field->type->ndim;
24017 while (*ts && *ts !=
')') {
24019 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
24022 number = __Pyx_BufFmt_ExpectNumber(&ts);
24023 if (
number == -1)
return NULL;
24024 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
24025 return PyErr_Format(PyExc_ValueError,
24026 "Expected a dimension of size %zu, got %d",
24027 ctx->head->field->type->arraysize[i],
number);
24028 if (*ts !=
',' && *ts !=
')')
24029 return PyErr_Format(PyExc_ValueError,
24030 "Expected a comma in format string, got '%c'", *ts);
24031 if (*ts ==
',') ts++;
24035 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
24036 ctx->head->field->type->ndim, i);
24038 PyErr_SetString(PyExc_ValueError,
24039 "Unexpected end of format string, expected ')'");
24042 ctx->is_valid_array = 1;
24043 ctx->new_count = 1;
24047 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
24052 if (ctx->enc_type != 0 && ctx->head == NULL) {
24053 __Pyx_BufFmt_RaiseExpected(ctx);
24056 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24057 if (ctx->head != NULL) {
24058 __Pyx_BufFmt_RaiseExpected(ctx);
24068 if (!__Pyx_Is_Little_Endian()) {
24069 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
24072 ctx->new_packmode =
'=';
24077 if (__Pyx_Is_Little_Endian()) {
24078 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
24081 ctx->new_packmode =
'=';
24087 ctx->new_packmode = *ts++;
24091 const char* ts_after_sub;
24092 size_t i, struct_count = ctx->new_count;
24093 size_t struct_alignment = ctx->struct_alignment;
24094 ctx->new_count = 1;
24097 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
24100 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24102 ctx->enc_count = 0;
24103 ctx->struct_alignment = 0;
24106 for (i = 0; i != struct_count; ++i) {
24107 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
24108 if (!ts_after_sub)
return NULL;
24111 if (struct_alignment) ctx->struct_alignment = struct_alignment;
24116 size_t alignment = ctx->struct_alignment;
24118 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24120 if (alignment && ctx->fmt_offset % alignment) {
24121 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
24126 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24127 ctx->fmt_offset += ctx->new_count;
24128 ctx->new_count = 1;
24129 ctx->enc_count = 0;
24131 ctx->enc_packmode = ctx->new_packmode;
24137 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
24138 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
24141 CYTHON_FALLTHROUGH;
24142 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
24143 case 'l':
case 'L':
case 'q':
case 'Q':
24144 case 'f':
case 'd':
case 'g':
24145 case 'O':
case 'p':
24146 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
24147 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
24148 ctx->enc_count += ctx->new_count;
24149 ctx->new_count = 1;
24154 CYTHON_FALLTHROUGH;
24156 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24157 ctx->enc_count = ctx->new_count;
24158 ctx->enc_packmode = ctx->new_packmode;
24159 ctx->enc_type = *ts;
24160 ctx->is_complex = got_Z;
24162 ctx->new_count = 1;
24167 while(*ts !=
':') ++ts;
24171 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
24175 int number = __Pyx_BufFmt_ExpectNumber(&ts);
24176 if (
number == -1)
return NULL;
24177 ctx->new_count = (size_t)
number;
24184 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
24185 if (unlikely(info->buf == NULL))
return;
24186 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
24187 __Pyx_ReleaseBuffer(info);
24189 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
24192 buf->strides = __Pyx_zeros;
24193 buf->shape = __Pyx_zeros;
24194 buf->suboffsets = __Pyx_minusones;
24196 static int __Pyx__GetBufferAndValidate(
24197 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype,
int flags,
24198 int nd,
int cast, __Pyx_BufFmt_StackElem* stack)
24201 if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
24202 __Pyx_ZeroBuffer(buf);
24205 if (unlikely(buf->ndim != nd)) {
24206 PyErr_Format(PyExc_ValueError,
24207 "Buffer has wrong number of dimensions (expected %d, got %d)",
24212 __Pyx_BufFmt_Context ctx;
24213 __Pyx_BufFmt_Init(&ctx, stack, dtype);
24214 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
24216 if (unlikely((
size_t)buf->itemsize != dtype->size)) {
24217 PyErr_Format(PyExc_ValueError,
24218 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"d byte%s)",
24219 buf->itemsize, (buf->itemsize > 1) ?
"s" :
"",
24220 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ?
"s" :
"");
24223 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
24226 __Pyx_SafeReleaseBuffer(buf);
24231 static void __Pyx_RaiseBufferIndexError(
int axis) {
24232 PyErr_Format(PyExc_IndexError,
24233 "Out of bounds on buffer access (axis %d)", axis);
24237 #if CYTHON_FAST_THREAD_STATE
24238 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24239 PyObject *tmp_type, *tmp_value, *tmp_tb;
24240 tmp_type = tstate->curexc_type;
24241 tmp_value = tstate->curexc_value;
24242 tmp_tb = tstate->curexc_traceback;
24243 tstate->curexc_type = type;
24244 tstate->curexc_value = value;
24245 tstate->curexc_traceback = tb;
24246 Py_XDECREF(tmp_type);
24247 Py_XDECREF(tmp_value);
24248 Py_XDECREF(tmp_tb);
24250 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24251 *type = tstate->curexc_type;
24252 *value = tstate->curexc_value;
24253 *tb = tstate->curexc_traceback;
24254 tstate->curexc_type = 0;
24255 tstate->curexc_value = 0;
24256 tstate->curexc_traceback = 0;
24261 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24262 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24264 value = PyDict_GetItemWithError(d, key);
24265 if (unlikely(!value)) {
24266 if (!PyErr_Occurred()) {
24267 if (unlikely(PyTuple_Check(key))) {
24268 PyObject* args = PyTuple_Pack(1, key);
24269 if (likely(args)) {
24270 PyErr_SetObject(PyExc_KeyError, args);
24274 PyErr_SetObject(PyExc_KeyError, key);
24285 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24287 if (!j)
return NULL;
24288 r = PyObject_GetItem(o, j);
24292 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24293 CYTHON_NCP_UNUSED
int wraparound,
24294 CYTHON_NCP_UNUSED
int boundscheck) {
24295 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24296 Py_ssize_t wrapped_i = i;
24297 if (wraparound & unlikely(i < 0)) {
24298 wrapped_i += PyList_GET_SIZE(o);
24300 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24301 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
24305 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24307 return PySequence_GetItem(o, i);
24310 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24311 CYTHON_NCP_UNUSED
int wraparound,
24312 CYTHON_NCP_UNUSED
int boundscheck) {
24313 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24314 Py_ssize_t wrapped_i = i;
24315 if (wraparound & unlikely(i < 0)) {
24316 wrapped_i += PyTuple_GET_SIZE(o);
24318 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24319 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
24323 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24325 return PySequence_GetItem(o, i);
24328 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24329 CYTHON_NCP_UNUSED
int wraparound,
24330 CYTHON_NCP_UNUSED
int boundscheck) {
24331 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24332 if (is_list || PyList_CheckExact(o)) {
24333 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24334 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
24335 PyObject *
r = PyList_GET_ITEM(o,
n);
24340 else if (PyTuple_CheckExact(o)) {
24341 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24342 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
24343 PyObject *
r = PyTuple_GET_ITEM(o,
n);
24348 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24349 if (likely(m && m->sq_item)) {
24350 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24351 Py_ssize_t l = m->sq_length(o);
24352 if (likely(l >= 0)) {
24355 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24360 return m->sq_item(o, i);
24364 if (is_list || PySequence_Check(o)) {
24365 return PySequence_GetItem(o, i);
24368 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24372 #if CYTHON_USE_TYPE_SLOTS
24373 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24375 Py_ssize_t key_value;
24376 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24377 if (unlikely(!(m && m->sq_item))) {
24378 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24381 key_value = __Pyx_PyIndex_AsSsize_t(index);
24382 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24383 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24385 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24387 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24391 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24392 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24393 if (likely(m && m->mp_subscript)) {
24394 return m->mp_subscript(obj, key);
24396 return __Pyx_PyObject_GetIndex(obj, key);
24401 #if !CYTHON_COMPILING_IN_PYPY
24402 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check) {
24403 const double b = floatval;
24406 (void)zerodivision_check;
24407 if (likely(PyFloat_CheckExact(op1))) {
24408 a = PyFloat_AS_DOUBLE(op1);
24411 #if PY_MAJOR_VERSION < 3
24412 if (likely(PyInt_CheckExact(op1))) {
24413 a = (double) PyInt_AS_LONG(op1);
24417 if (likely(PyLong_CheckExact(op1))) {
24418 #if CYTHON_USE_PYLONG_INTERNALS
24419 const digit* digits = ((PyLongObject*)op1)->ob_digit;
24420 const Py_ssize_t size = Py_SIZE(op1);
24422 case 0: a = 0.0;
break;
24423 case -1: a = -(double) digits[0];
break;
24424 case 1: a = (double) digits[0];
break;
24427 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
24428 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24429 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
24435 CYTHON_FALLTHROUGH;
24438 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
24439 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24440 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
24446 CYTHON_FALLTHROUGH;
24449 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
24450 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24451 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
24457 CYTHON_FALLTHROUGH;
24462 a = PyLong_AsDouble(op1);
24463 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
24467 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24470 PyFPE_START_PROTECT(
"add",
return NULL)
24472 PyFPE_END_PROTECT(result)
24473 return PyFloat_FromDouble(result);
24478 #if CYTHON_FAST_PYCALL
24479 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24480 PyObject *globals) {
24482 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24483 PyObject **fastlocals;
24486 assert(globals != NULL);
24491 assert(tstate != NULL);
24492 f = PyFrame_New(tstate, co, globals, NULL);
24496 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
24497 for (i = 0; i < na; i++) {
24499 fastlocals[i] = *args++;
24501 result = PyEval_EvalFrameEx(
f,0);
24502 ++tstate->recursion_depth;
24504 --tstate->recursion_depth;
24507 #if 1 || PY_VERSION_HEX < 0x030600B1
24508 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24509 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24510 PyObject *globals = PyFunction_GET_GLOBALS(func);
24511 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24513 #if PY_MAJOR_VERSION >= 3
24516 PyObject *kwtuple, **k;
24521 assert(kwargs == NULL || PyDict_Check(kwargs));
24522 nk = kwargs ? PyDict_Size(kwargs) : 0;
24523 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24527 #
if PY_MAJOR_VERSION >= 3
24528 co->co_kwonlyargcount == 0 &&
24530 likely(kwargs == NULL || nk == 0) &&
24531 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24532 if (argdefs == NULL && co->co_argcount == nargs) {
24533 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24536 else if (nargs == 0 && argdefs != NULL
24537 && co->co_argcount == Py_SIZE(argdefs)) {
24540 args = &PyTuple_GET_ITEM(argdefs, 0);
24541 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24545 if (kwargs != NULL) {
24547 kwtuple = PyTuple_New(2 * nk);
24548 if (kwtuple == NULL) {
24552 k = &PyTuple_GET_ITEM(kwtuple, 0);
24554 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
24565 closure = PyFunction_GET_CLOSURE(func);
24566 #if PY_MAJOR_VERSION >= 3
24567 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24569 if (argdefs != NULL) {
24570 d = &PyTuple_GET_ITEM(argdefs, 0);
24571 nd = Py_SIZE(argdefs);
24577 #if PY_MAJOR_VERSION >= 3
24578 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24581 d, (
int)nd, kwdefs, closure);
24583 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24586 d, (
int)nd, closure);
24588 Py_XDECREF(kwtuple);
24590 Py_LeaveRecursiveCall();
24597 #if CYTHON_FAST_PYCCALL
24598 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24599 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24600 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24601 PyObject *
self = PyCFunction_GET_SELF(func);
24602 int flags = PyCFunction_GET_FLAGS(func);
24603 assert(PyCFunction_Check(func));
24604 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24605 assert(nargs >= 0);
24606 assert(nargs == 0 || args != NULL);
24610 assert(!PyErr_Occurred());
24611 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24612 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
24614 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
24620 #if CYTHON_COMPILING_IN_CPYTHON
24621 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24623 ternaryfunc call = Py_TYPE(func)->tp_call;
24624 if (unlikely(!call))
24625 return PyObject_Call(func, arg, kw);
24626 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24628 result = (*call)(func, arg, kw);
24629 Py_LeaveRecursiveCall();
24630 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24633 "NULL result without error in PyObject_Call");
24640 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24641 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24642 PyObject *dict = Py_TYPE(obj)->tp_dict;
24643 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24645 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24646 PyObject **dictptr = NULL;
24647 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24649 #if CYTHON_COMPILING_IN_CPYTHON
24650 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
24652 dictptr = _PyObject_GetDictPtr(obj);
24655 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24657 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24658 PyObject *dict = Py_TYPE(obj)->tp_dict;
24659 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24661 return obj_dict_version == __Pyx_get_object_dict_version(obj);
24666 #if CYTHON_USE_DICT_VERSIONS
24667 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24669 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24673 #if !CYTHON_AVOID_BORROWED_REFS
24674 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24675 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24676 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24677 if (likely(result)) {
24678 return __Pyx_NewRef(result);
24679 }
else if (unlikely(PyErr_Occurred())) {
24683 result = PyDict_GetItem(__pyx_d, name);
24684 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24685 if (likely(result)) {
24686 return __Pyx_NewRef(result);
24690 result = PyObject_GetItem(__pyx_d, name);
24691 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24692 if (likely(result)) {
24693 return __Pyx_NewRef(result);
24697 return __Pyx_GetBuiltinName(name);
24701 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24702 if (unlikely(!type)) {
24703 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24706 if (likely(__Pyx_TypeCheck(obj, type)))
24708 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
24709 Py_TYPE(obj)->tp_name, type->tp_name);
24714 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
24715 PyObject *args, *result = NULL;
24716 #if CYTHON_FAST_PYCALL
24717 if (PyFunction_Check(
function)) {
24718 PyObject *args[2] = {arg1, arg2};
24719 return __Pyx_PyFunction_FastCall(
function, args, 2);
24722 #if CYTHON_FAST_PYCCALL
24723 if (__Pyx_PyFastCFunction_Check(
function)) {
24724 PyObject *args[2] = {arg1, arg2};
24725 return __Pyx_PyCFunction_FastCall(
function, args, 2);
24728 args = PyTuple_New(2);
24729 if (unlikely(!args))
goto done;
24731 PyTuple_SET_ITEM(args, 0, arg1);
24733 PyTuple_SET_ITEM(args, 1, arg2);
24734 Py_INCREF(
function);
24735 result = __Pyx_PyObject_Call(
function, args, NULL);
24737 Py_DECREF(
function);
24743 #if CYTHON_COMPILING_IN_CPYTHON
24744 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24745 PyObject *
self, *result;
24747 cfunc = PyCFunction_GET_FUNCTION(func);
24748 self = PyCFunction_GET_SELF(func);
24749 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24751 result = cfunc(
self, arg);
24752 Py_LeaveRecursiveCall();
24753 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24756 "NULL result without error in PyObject_Call");
24763 #if CYTHON_COMPILING_IN_CPYTHON
24764 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24766 PyObject *args = PyTuple_New(1);
24767 if (unlikely(!args))
return NULL;
24769 PyTuple_SET_ITEM(args, 0, arg);
24770 result = __Pyx_PyObject_Call(func, args, NULL);
24774 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24775 #if CYTHON_FAST_PYCALL
24776 if (PyFunction_Check(func)) {
24777 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24780 if (likely(PyCFunction_Check(func))) {
24781 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24782 return __Pyx_PyObject_CallMethO(func, arg);
24783 #if CYTHON_FAST_PYCCALL
24784 }
else if (__Pyx_PyFastCFunction_Check(func)) {
24785 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24789 return __Pyx__PyObject_CallOneArg(func, arg);
24792 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24794 PyObject *args = PyTuple_Pack(1, arg);
24795 if (unlikely(!args))
return NULL;
24796 result = __Pyx_PyObject_Call(func, args, NULL);
24803 static double __Pyx__PyObject_AsDouble(PyObject* obj) {
24804 PyObject* float_value;
24805 #if !CYTHON_USE_TYPE_SLOTS
24806 float_value = PyNumber_Float(obj);
if ((0))
goto bad;
24808 PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
24809 if (likely(nb) && likely(nb->nb_float)) {
24810 float_value = nb->nb_float(obj);
24811 if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
24812 PyErr_Format(PyExc_TypeError,
24813 "__float__ returned non-float (type %.200s)",
24814 Py_TYPE(float_value)->tp_name);
24815 Py_DECREF(float_value);
24818 }
else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
24819 #if PY_MAJOR_VERSION >= 3
24820 float_value = PyFloat_FromString(obj);
24822 float_value = PyFloat_FromString(obj, 0);
24825 PyObject* args = PyTuple_New(1);
24826 if (unlikely(!args))
goto bad;
24827 PyTuple_SET_ITEM(args, 0, obj);
24828 float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
24829 PyTuple_SET_ITEM(args, 0, 0);
24833 if (likely(float_value)) {
24834 double value = PyFloat_AS_DOUBLE(float_value);
24835 Py_DECREF(float_value);
24843 #if CYTHON_USE_EXC_INFO_STACK
24844 static _PyErr_StackItem *
24845 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24847 _PyErr_StackItem *exc_info = tstate->exc_info;
24848 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24849 exc_info->previous_item != NULL)
24851 exc_info = exc_info->previous_item;
24858 #if CYTHON_FAST_THREAD_STATE
24859 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24860 #if CYTHON_USE_EXC_INFO_STACK
24861 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24862 *type = exc_info->exc_type;
24863 *value = exc_info->exc_value;
24864 *tb = exc_info->exc_traceback;
24866 *type = tstate->exc_type;
24867 *value = tstate->exc_value;
24868 *tb = tstate->exc_traceback;
24871 Py_XINCREF(*value);
24874 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24875 PyObject *tmp_type, *tmp_value, *tmp_tb;
24876 #if CYTHON_USE_EXC_INFO_STACK
24877 _PyErr_StackItem *exc_info = tstate->exc_info;
24878 tmp_type = exc_info->exc_type;
24879 tmp_value = exc_info->exc_value;
24880 tmp_tb = exc_info->exc_traceback;
24881 exc_info->exc_type = type;
24882 exc_info->exc_value = value;
24883 exc_info->exc_traceback = tb;
24885 tmp_type = tstate->exc_type;
24886 tmp_value = tstate->exc_value;
24887 tmp_tb = tstate->exc_traceback;
24888 tstate->exc_type = type;
24889 tstate->exc_value = value;
24890 tstate->exc_traceback = tb;
24892 Py_XDECREF(tmp_type);
24893 Py_XDECREF(tmp_value);
24894 Py_XDECREF(tmp_tb);
24899 #if CYTHON_FAST_THREAD_STATE
24900 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24902 n = PyTuple_GET_SIZE(tuple);
24903 #if PY_MAJOR_VERSION >= 3
24904 for (i=0; i<
n; i++) {
24905 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24908 for (i=0; i<
n; i++) {
24909 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24913 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24914 PyObject *exc_type = tstate->curexc_type;
24915 if (exc_type == err)
return 1;
24916 if (unlikely(!exc_type))
return 0;
24917 if (unlikely(PyTuple_Check(err)))
24918 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24919 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24924 #if CYTHON_FAST_THREAD_STATE
24925 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
24927 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
24930 PyObject *local_type, *local_value, *local_tb;
24931 #if CYTHON_FAST_THREAD_STATE
24932 PyObject *tmp_type, *tmp_value, *tmp_tb;
24933 local_type = tstate->curexc_type;
24934 local_value = tstate->curexc_value;
24935 local_tb = tstate->curexc_traceback;
24936 tstate->curexc_type = 0;
24937 tstate->curexc_value = 0;
24938 tstate->curexc_traceback = 0;
24940 PyErr_Fetch(&local_type, &local_value, &local_tb);
24942 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24943 #if CYTHON_FAST_THREAD_STATE
24944 if (unlikely(tstate->curexc_type))
24946 if (unlikely(PyErr_Occurred()))
24949 #if PY_MAJOR_VERSION >= 3
24951 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24955 Py_XINCREF(local_tb);
24956 Py_XINCREF(local_type);
24957 Py_XINCREF(local_value);
24958 *type = local_type;
24959 *value = local_value;
24961 #if CYTHON_FAST_THREAD_STATE
24962 #if CYTHON_USE_EXC_INFO_STACK
24964 _PyErr_StackItem *exc_info = tstate->exc_info;
24965 tmp_type = exc_info->exc_type;
24966 tmp_value = exc_info->exc_value;
24967 tmp_tb = exc_info->exc_traceback;
24968 exc_info->exc_type = local_type;
24969 exc_info->exc_value = local_value;
24970 exc_info->exc_traceback = local_tb;
24973 tmp_type = tstate->exc_type;
24974 tmp_value = tstate->exc_value;
24975 tmp_tb = tstate->exc_traceback;
24976 tstate->exc_type = local_type;
24977 tstate->exc_value = local_value;
24978 tstate->exc_traceback = local_tb;
24980 Py_XDECREF(tmp_type);
24981 Py_XDECREF(tmp_value);
24982 Py_XDECREF(tmp_tb);
24984 PyErr_SetExcInfo(local_type, local_value, local_tb);
24991 Py_XDECREF(local_type);
24992 Py_XDECREF(local_value);
24993 Py_XDECREF(local_tb);
24998 #if PY_MAJOR_VERSION < 3
24999 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25000 CYTHON_UNUSED PyObject *cause) {
25001 __Pyx_PyThreadState_declare
25003 if (!value || value == Py_None)
25007 if (!tb || tb == Py_None)
25011 if (!PyTraceBack_Check(tb)) {
25012 PyErr_SetString(PyExc_TypeError,
25013 "raise: arg 3 must be a traceback or None");
25017 if (PyType_Check(type)) {
25018 #if CYTHON_COMPILING_IN_PYPY
25020 Py_INCREF(Py_None);
25024 PyErr_NormalizeException(&type, &value, &tb);
25027 PyErr_SetString(PyExc_TypeError,
25028 "instance exception may not have a separate value");
25032 type = (PyObject*) Py_TYPE(type);
25034 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25035 PyErr_SetString(PyExc_TypeError,
25036 "raise: exception class must be a subclass of BaseException");
25040 __Pyx_PyThreadState_assign
25041 __Pyx_ErrRestore(type, value, tb);
25050 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25051 PyObject* owned_instance = NULL;
25052 if (tb == Py_None) {
25054 }
else if (tb && !PyTraceBack_Check(tb)) {
25055 PyErr_SetString(PyExc_TypeError,
25056 "raise: arg 3 must be a traceback or None");
25059 if (value == Py_None)
25061 if (PyExceptionInstance_Check(type)) {
25063 PyErr_SetString(PyExc_TypeError,
25064 "instance exception may not have a separate value");
25068 type = (PyObject*) Py_TYPE(value);
25069 }
else if (PyExceptionClass_Check(type)) {
25070 PyObject *instance_class = NULL;
25071 if (value && PyExceptionInstance_Check(value)) {
25072 instance_class = (PyObject*) Py_TYPE(value);
25073 if (instance_class != type) {
25074 int is_subclass = PyObject_IsSubclass(instance_class, type);
25075 if (!is_subclass) {
25076 instance_class = NULL;
25077 }
else if (unlikely(is_subclass == -1)) {
25080 type = instance_class;
25084 if (!instance_class) {
25087 args = PyTuple_New(0);
25088 else if (PyTuple_Check(value)) {
25092 args = PyTuple_Pack(1, value);
25095 owned_instance = PyObject_Call(type, args, NULL);
25097 if (!owned_instance)
25099 value = owned_instance;
25100 if (!PyExceptionInstance_Check(value)) {
25101 PyErr_Format(PyExc_TypeError,
25102 "calling %R should have returned an instance of "
25103 "BaseException, not %R",
25104 type, Py_TYPE(value));
25109 PyErr_SetString(PyExc_TypeError,
25110 "raise: exception class must be a subclass of BaseException");
25114 PyObject *fixed_cause;
25115 if (cause == Py_None) {
25116 fixed_cause = NULL;
25117 }
else if (PyExceptionClass_Check(cause)) {
25118 fixed_cause = PyObject_CallObject(cause, NULL);
25119 if (fixed_cause == NULL)
25121 }
else if (PyExceptionInstance_Check(cause)) {
25122 fixed_cause = cause;
25123 Py_INCREF(fixed_cause);
25125 PyErr_SetString(PyExc_TypeError,
25126 "exception causes must derive from "
25130 PyException_SetCause(value, fixed_cause);
25132 PyErr_SetObject(type, value);
25134 #if CYTHON_COMPILING_IN_PYPY
25135 PyObject *tmp_type, *tmp_value, *tmp_tb;
25136 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25138 PyErr_Restore(tmp_type, tmp_value, tb);
25139 Py_XDECREF(tmp_tb);
25141 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25142 PyObject* tmp_tb = tstate->curexc_traceback;
25143 if (tb != tmp_tb) {
25145 tstate->curexc_traceback = tb;
25146 Py_XDECREF(tmp_tb);
25151 Py_XDECREF(owned_instance);
25157 #ifndef __PYX_HAVE_RT_ImportType
25158 #define __PYX_HAVE_RT_ImportType
25159 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
25160 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
25162 PyObject *result = 0;
25164 Py_ssize_t basicsize;
25165 #ifdef Py_LIMITED_API
25166 PyObject *py_basicsize;
25168 result = PyObject_GetAttrString(module, class_name);
25171 if (!PyType_Check(result)) {
25172 PyErr_Format(PyExc_TypeError,
25173 "%.200s.%.200s is not a type object",
25174 module_name, class_name);
25177 #ifndef Py_LIMITED_API
25178 basicsize = ((PyTypeObject *)result)->tp_basicsize;
25180 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
25183 basicsize = PyLong_AsSsize_t(py_basicsize);
25184 Py_DECREF(py_basicsize);
25186 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25189 if ((
size_t)basicsize < size) {
25190 PyErr_Format(PyExc_ValueError,
25191 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25192 "Expected %zd from C header, got %zd from PyObject",
25193 module_name, class_name, size, basicsize);
25196 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
25197 PyErr_Format(PyExc_ValueError,
25198 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25199 "Expected %zd from C header, got %zd from PyObject",
25200 module_name, class_name, size, basicsize);
25203 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
25204 PyOS_snprintf(warning,
sizeof(warning),
25205 "%s.%s size changed, may indicate binary incompatibility. "
25206 "Expected %zd from C header, got %zd from PyObject",
25207 module_name, class_name, size, basicsize);
25208 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
25210 return (PyTypeObject *)result;
25212 Py_XDECREF(result);
25218 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25219 PyObject *empty_list = 0;
25220 PyObject *module = 0;
25221 PyObject *global_dict = 0;
25222 PyObject *empty_dict = 0;
25224 #if PY_MAJOR_VERSION < 3
25225 PyObject *py_import;
25226 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25233 empty_list = PyList_New(0);
25238 global_dict = PyModule_GetDict(__pyx_m);
25241 empty_dict = PyDict_New();
25245 #if PY_MAJOR_VERSION >= 3
25247 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
25248 module = PyImport_ImportModuleLevelObject(
25249 name, global_dict, empty_dict, list, 1);
25251 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25260 #if PY_MAJOR_VERSION < 3
25261 PyObject *py_level = PyInt_FromLong(level);
25264 module = PyObject_CallFunctionObjArgs(py_import,
25265 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25266 Py_DECREF(py_level);
25268 module = PyImport_ImportModuleLevelObject(
25269 name, global_dict, empty_dict, list, level);
25274 #if PY_MAJOR_VERSION < 3
25275 Py_XDECREF(py_import);
25277 Py_XDECREF(empty_list);
25278 Py_XDECREF(empty_dict);
25283 #ifndef CYTHON_CLINE_IN_TRACEBACK
25284 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
25285 PyObject *use_cline;
25286 PyObject *ptype, *pvalue, *ptraceback;
25287 #if CYTHON_COMPILING_IN_CPYTHON
25288 PyObject **cython_runtime_dict;
25290 if (unlikely(!__pyx_cython_runtime)) {
25293 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25294 #if CYTHON_COMPILING_IN_CPYTHON
25295 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25296 if (likely(cython_runtime_dict)) {
25297 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25298 use_cline, *cython_runtime_dict,
25299 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25303 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25304 if (use_cline_obj) {
25305 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25306 Py_DECREF(use_cline_obj);
25314 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25316 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25319 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25325 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
25326 int start = 0, mid = 0, end = count - 1;
25327 if (end >= 0 && code_line > entries[end].code_line) {
25330 while (start < end) {
25331 mid = start + (end - start) / 2;
25332 if (code_line < entries[mid].code_line) {
25334 }
else if (code_line > entries[mid].code_line) {
25340 if (code_line <= entries[mid].code_line) {
25346 static PyCodeObject *__pyx_find_code_object(
int code_line) {
25347 PyCodeObject* code_object;
25349 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25352 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25353 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
25356 code_object = __pyx_code_cache.entries[
pos].code_object;
25357 Py_INCREF(code_object);
25358 return code_object;
25360 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
25362 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25363 if (unlikely(!code_line)) {
25366 if (unlikely(!entries)) {
25367 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
25368 if (likely(entries)) {
25369 __pyx_code_cache.entries = entries;
25370 __pyx_code_cache.max_count = 64;
25371 __pyx_code_cache.count = 1;
25372 entries[0].code_line = code_line;
25373 entries[0].code_object = code_object;
25374 Py_INCREF(code_object);
25378 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25379 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
25380 PyCodeObject* tmp = entries[
pos].code_object;
25381 entries[
pos].code_object = code_object;
25385 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25386 int new_max = __pyx_code_cache.max_count + 64;
25387 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25388 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
25389 if (unlikely(!entries)) {
25392 __pyx_code_cache.entries = entries;
25393 __pyx_code_cache.max_count = new_max;
25395 for (i=__pyx_code_cache.count; i>
pos; i--) {
25396 entries[i] = entries[i-1];
25398 entries[
pos].code_line = code_line;
25399 entries[
pos].code_object = code_object;
25400 __pyx_code_cache.count++;
25401 Py_INCREF(code_object);
25405 #include "compile.h"
25406 #include "frameobject.h"
25407 #include "traceback.h"
25408 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25409 const char *funcname,
int c_line,
25410 int py_line,
const char *filename) {
25411 PyCodeObject *py_code = 0;
25412 PyObject *py_srcfile = 0;
25413 PyObject *py_funcname = 0;
25414 #if PY_MAJOR_VERSION < 3
25415 py_srcfile = PyString_FromString(filename);
25417 py_srcfile = PyUnicode_FromString(filename);
25419 if (!py_srcfile)
goto bad;
25421 #if PY_MAJOR_VERSION < 3
25422 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25424 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25428 #if PY_MAJOR_VERSION < 3
25429 py_funcname = PyString_FromString(funcname);
25431 py_funcname = PyUnicode_FromString(funcname);
25434 if (!py_funcname)
goto bad;
25435 py_code = __Pyx_PyCode_New(
25452 Py_DECREF(py_srcfile);
25453 Py_DECREF(py_funcname);
25456 Py_XDECREF(py_srcfile);
25457 Py_XDECREF(py_funcname);
25460 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
25461 int py_line,
const char *filename) {
25462 PyCodeObject *py_code = 0;
25463 PyFrameObject *py_frame = 0;
25464 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25466 c_line = __Pyx_CLineForTraceback(tstate, c_line);
25468 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25470 py_code = __Pyx_CreateCodeObjectForTraceback(
25471 funcname, c_line, py_line, filename);
25472 if (!py_code)
goto bad;
25473 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25475 py_frame = PyFrame_New(
25481 if (!py_frame)
goto bad;
25482 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25483 PyTraceBack_Here(py_frame);
25485 Py_XDECREF(py_code);
25486 Py_XDECREF(py_frame);
25489 #if PY_MAJOR_VERSION < 3
25490 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
25491 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
25492 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
25495 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
25496 PyObject *obj = view->obj;
25498 if (PyObject_CheckBuffer(obj)) {
25499 PyBuffer_Release(view);
25510 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
25511 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
25512 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
25513 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
25514 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
25516 func_type value = func_value;\
25517 if (sizeof(target_type) < sizeof(func_type)) {\
25518 if (unlikely(value != (func_type) (target_type) value)) {\
25519 func_type zero = 0;\
25520 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
25521 return (target_type) -1;\
25522 if (is_unsigned && unlikely(value < zero))\
25523 goto raise_neg_overflow;\
25525 goto raise_overflow;\
25528 return (target_type) value;\
25532 #if CYTHON_CCOMPLEX
25534 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25535 return ::std::complex< float >(x, y);
25538 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25539 return x + y*(__pyx_t_float_complex)_Complex_I;
25543 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25544 __pyx_t_float_complex
z;
25552 #if CYTHON_CCOMPLEX
25554 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25555 return (a.real == b.real) && (a.imag == b.imag);
25557 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25558 __pyx_t_float_complex
z;
25559 z.real = a.real + b.real;
25560 z.imag = a.imag + b.imag;
25563 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25564 __pyx_t_float_complex
z;
25565 z.real = a.real - b.real;
25566 z.imag = a.imag - b.imag;
25569 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25570 __pyx_t_float_complex
z;
25571 z.real = a.real * b.real - a.imag * b.imag;
25572 z.imag = a.real * b.imag + a.imag * b.real;
25576 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25578 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
25579 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
25580 if (b.real == 0 && b.imag == 0) {
25581 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
25583 float r = b.imag / b.real;
25584 float s = (float)(1.0) / (b.real + b.imag *
r);
25585 return __pyx_t_float_complex_from_parts(
25586 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
25589 float r = b.real / b.imag;
25590 float s = (float)(1.0) / (b.imag + b.real *
r);
25591 return __pyx_t_float_complex_from_parts(
25592 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
25596 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25598 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
25600 float denom = b.real * b.real + b.imag * b.imag;
25601 return __pyx_t_float_complex_from_parts(
25602 (a.real * b.real + a.imag * b.imag) / denom,
25603 (a.imag * b.real - a.real * b.imag) / denom);
25607 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
25608 __pyx_t_float_complex
z;
25613 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
25614 return (a.real == 0) && (a.imag == 0);
25616 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
25617 __pyx_t_float_complex
z;
25623 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
25624 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
25625 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
25627 return hypotf(
z.real,
z.imag);
25630 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25631 __pyx_t_float_complex
z;
25632 float r, lnr, theta, z_r, z_theta;
25633 if (b.imag == 0 && b.real == (
int)b.real) {
25635 float denom = a.real * a.real + a.imag * a.imag;
25636 a.real = a.real / denom;
25637 a.imag = -a.imag / denom;
25640 switch ((
int)b.real) {
25648 return __Pyx_c_prod_float(a, a);
25650 z = __Pyx_c_prod_float(a, a);
25651 return __Pyx_c_prod_float(
z, a);
25653 z = __Pyx_c_prod_float(a, a);
25654 return __Pyx_c_prod_float(
z,
z);
25660 }
else if (b.imag == 0) {
25661 z.real = powf(a.real, b.real);
25664 }
else if (a.real > 0) {
25669 theta = atan2f(0.0, -1.0);
25672 r = __Pyx_c_abs_float(a);
25673 theta = atan2f(a.imag, a.real);
25676 z_r = expf(lnr * b.real - theta * b.imag);
25677 z_theta = theta * b.real + lnr * b.imag;
25678 z.real = z_r * cosf(z_theta);
25679 z.imag = z_r * sinf(z_theta);
25686 #if CYTHON_CCOMPLEX
25688 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
25689 return ::std::complex< double >(x, y);
25692 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
25693 return x + y*(__pyx_t_double_complex)_Complex_I;
25697 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
25698 __pyx_t_double_complex
z;
25706 #if CYTHON_CCOMPLEX
25708 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25709 return (a.real == b.real) && (a.imag == b.imag);
25711 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25712 __pyx_t_double_complex
z;
25713 z.real = a.real + b.real;
25714 z.imag = a.imag + b.imag;
25717 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25718 __pyx_t_double_complex
z;
25719 z.real = a.real - b.real;
25720 z.imag = a.imag - b.imag;
25723 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25724 __pyx_t_double_complex
z;
25725 z.real = a.real * b.real - a.imag * b.imag;
25726 z.imag = a.real * b.imag + a.imag * b.real;
25730 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25732 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
25733 }
else if (fabs(b.real) >= fabs(b.imag)) {
25734 if (b.real == 0 && b.imag == 0) {
25735 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
25737 double r = b.imag / b.real;
25738 double s = (double)(1.0) / (b.real + b.imag *
r);
25739 return __pyx_t_double_complex_from_parts(
25740 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
25743 double r = b.real / b.imag;
25744 double s = (double)(1.0) / (b.imag + b.real *
r);
25745 return __pyx_t_double_complex_from_parts(
25746 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
25750 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25752 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
25754 double denom = b.real * b.real + b.imag * b.imag;
25755 return __pyx_t_double_complex_from_parts(
25756 (a.real * b.real + a.imag * b.imag) / denom,
25757 (a.imag * b.real - a.real * b.imag) / denom);
25761 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
25762 __pyx_t_double_complex
z;
25767 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
25768 return (a.real == 0) && (a.imag == 0);
25770 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
25771 __pyx_t_double_complex
z;
25777 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
25778 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
25779 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
25781 return hypot(
z.real,
z.imag);
25784 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25785 __pyx_t_double_complex
z;
25786 double r, lnr, theta, z_r, z_theta;
25787 if (b.imag == 0 && b.real == (
int)b.real) {
25789 double denom = a.real * a.real + a.imag * a.imag;
25790 a.real = a.real / denom;
25791 a.imag = -a.imag / denom;
25794 switch ((
int)b.real) {
25802 return __Pyx_c_prod_double(a, a);
25804 z = __Pyx_c_prod_double(a, a);
25805 return __Pyx_c_prod_double(
z, a);
25807 z = __Pyx_c_prod_double(a, a);
25808 return __Pyx_c_prod_double(
z,
z);
25814 }
else if (b.imag == 0) {
25815 z.real = pow(a.real, b.real);
25818 }
else if (a.real > 0) {
25823 theta = atan2(0.0, -1.0);
25826 r = __Pyx_c_abs_double(a);
25827 theta = atan2(a.imag, a.real);
25830 z_r = exp(lnr * b.real - theta * b.imag);
25831 z_theta = theta * b.real + lnr * b.imag;
25832 z.real = z_r * cos(z_theta);
25833 z.imag = z_r * sin(z_theta);
25840 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
25841 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25842 #pragma GCC diagnostic push
25843 #pragma GCC diagnostic ignored "-Wconversion"
25845 const int neg_one = (int) -1, const_zero = (
int) 0;
25846 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25847 #pragma GCC diagnostic pop
25849 const int is_unsigned = neg_one > const_zero;
25850 #if PY_MAJOR_VERSION < 3
25851 if (likely(PyInt_Check(x))) {
25852 if (
sizeof(
int) <
sizeof(long)) {
25853 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
25855 long val = PyInt_AS_LONG(x);
25856 if (is_unsigned && unlikely(val < 0)) {
25857 goto raise_neg_overflow;
25863 if (likely(PyLong_Check(x))) {
25865 #if CYTHON_USE_PYLONG_INTERNALS
25866 const digit* digits = ((PyLongObject*)x)->ob_digit;
25867 switch (Py_SIZE(x)) {
25868 case 0:
return (
int) 0;
25869 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
25871 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
25872 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25873 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25874 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
25875 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
25880 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
25881 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25882 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25883 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
25884 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
25889 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
25890 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
25891 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25892 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
25893 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
25899 #if CYTHON_COMPILING_IN_CPYTHON
25900 if (unlikely(Py_SIZE(x) < 0)) {
25901 goto raise_neg_overflow;
25905 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
25906 if (unlikely(result < 0))
25908 if (unlikely(result == 1))
25909 goto raise_neg_overflow;
25912 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
25913 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
25914 #ifdef HAVE_LONG_LONG
25915 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
25916 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
25920 #if CYTHON_USE_PYLONG_INTERNALS
25921 const digit* digits = ((PyLongObject*)x)->ob_digit;
25922 switch (Py_SIZE(x)) {
25923 case 0:
return (
int) 0;
25924 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
25925 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
25927 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
25928 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25929 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25930 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
25931 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
25936 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
25937 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25938 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25939 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
25940 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
25945 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
25946 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25947 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25948 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
25949 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
25954 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
25955 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25956 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25957 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
25958 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
25963 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
25964 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
25965 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25966 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
25967 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
25972 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
25973 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
25974 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25975 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
25976 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
25982 if (
sizeof(
int) <=
sizeof(long)) {
25983 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
25984 #ifdef HAVE_LONG_LONG
25985 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
25986 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
25991 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
25992 PyErr_SetString(PyExc_RuntimeError,
25993 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
25996 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
25997 #if PY_MAJOR_VERSION < 3
25998 if (likely(
v) && !PyLong_Check(
v)) {
26000 v = PyNumber_Long(tmp);
26005 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
26006 unsigned char *bytes = (
unsigned char *)&val;
26007 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
26008 bytes,
sizeof(val),
26009 is_little, !is_unsigned);
26019 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26020 if (!tmp)
return (
int) -1;
26021 val = __Pyx_PyInt_As_int(tmp);
26026 PyErr_SetString(PyExc_OverflowError,
26027 "value too large to convert to int");
26029 raise_neg_overflow:
26030 PyErr_SetString(PyExc_OverflowError,
26031 "can't convert negative value to int");
26036 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
26037 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26038 #pragma GCC diagnostic push
26039 #pragma GCC diagnostic ignored "-Wconversion"
26041 const int neg_one = (int) -1, const_zero = (
int) 0;
26042 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26043 #pragma GCC diagnostic pop
26045 const int is_unsigned = neg_one > const_zero;
26047 if (
sizeof(
int) <
sizeof(long)) {
26048 return PyInt_FromLong((
long) value);
26049 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
26050 return PyLong_FromUnsignedLong((
unsigned long) value);
26051 #ifdef HAVE_LONG_LONG
26052 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
26053 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26057 if (
sizeof(
int) <=
sizeof(
long)) {
26058 return PyInt_FromLong((
long) value);
26059 #ifdef HAVE_LONG_LONG
26060 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
26061 return PyLong_FromLongLong((PY_LONG_LONG) value);
26066 int one = 1;
int little = (int)*(
unsigned char *)&one;
26067 unsigned char *bytes = (
unsigned char *)&value;
26068 return _PyLong_FromByteArray(bytes,
sizeof(
int),
26069 little, !is_unsigned);
26074 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
26075 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26076 #pragma GCC diagnostic push
26077 #pragma GCC diagnostic ignored "-Wconversion"
26079 const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
26080 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26081 #pragma GCC diagnostic pop
26083 const int is_unsigned = neg_one > const_zero;
26085 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
26086 return PyInt_FromLong((
long) value);
26087 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
26088 return PyLong_FromUnsignedLong((
unsigned long) value);
26089 #ifdef HAVE_LONG_LONG
26090 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
26091 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26095 if (
sizeof(Py_intptr_t) <=
sizeof(
long)) {
26096 return PyInt_FromLong((
long) value);
26097 #ifdef HAVE_LONG_LONG
26098 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
26099 return PyLong_FromLongLong((PY_LONG_LONG) value);
26104 int one = 1;
int little = (int)*(
unsigned char *)&one;
26105 unsigned char *bytes = (
unsigned char *)&value;
26106 return _PyLong_FromByteArray(bytes,
sizeof(Py_intptr_t),
26107 little, !is_unsigned);
26112 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
26113 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26114 #pragma GCC diagnostic push
26115 #pragma GCC diagnostic ignored "-Wconversion"
26117 const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
26118 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26119 #pragma GCC diagnostic pop
26121 const int is_unsigned = neg_one > const_zero;
26122 #if PY_MAJOR_VERSION < 3
26123 if (likely(PyInt_Check(x))) {
26124 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
26125 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, PyInt_AS_LONG(x))
26127 long val = PyInt_AS_LONG(x);
26128 if (is_unsigned && unlikely(val < 0)) {
26129 goto raise_neg_overflow;
26131 return (Py_intptr_t) val;
26135 if (likely(PyLong_Check(x))) {
26137 #if CYTHON_USE_PYLONG_INTERNALS
26138 const digit* digits = ((PyLongObject*)x)->ob_digit;
26139 switch (Py_SIZE(x)) {
26140 case 0:
return (Py_intptr_t) 0;
26141 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
26143 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
26144 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26145 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26146 }
else if (8 *
sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
26147 return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26152 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
26153 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26154 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26155 }
else if (8 *
sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
26156 return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26161 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
26162 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26163 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26164 }
else if (8 *
sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
26165 return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26171 #if CYTHON_COMPILING_IN_CPYTHON
26172 if (unlikely(Py_SIZE(x) < 0)) {
26173 goto raise_neg_overflow;
26177 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26178 if (unlikely(result < 0))
26179 return (Py_intptr_t) -1;
26180 if (unlikely(result == 1))
26181 goto raise_neg_overflow;
26184 if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
26185 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned long, PyLong_AsUnsignedLong(x))
26186 #ifdef HAVE_LONG_LONG
26187 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
26188 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26192 #if CYTHON_USE_PYLONG_INTERNALS
26193 const digit* digits = ((PyLongObject*)x)->ob_digit;
26194 switch (Py_SIZE(x)) {
26195 case 0:
return (Py_intptr_t) 0;
26196 case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0]))
26197 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0])
26199 if (8 *
sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
26200 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26201 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26202 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26203 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26208 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
26209 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26210 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26211 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26212 return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26217 if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26218 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26219 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26220 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26221 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26226 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
26227 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26228 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26229 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26230 return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26235 if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26236 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26237 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26238 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
26239 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26244 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
26245 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26246 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26247 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
26248 return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26254 if (
sizeof(Py_intptr_t) <=
sizeof(long)) {
26255 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
long, PyLong_AsLong(x))
26256 #ifdef HAVE_LONG_LONG
26257 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
26258 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
26263 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26264 PyErr_SetString(PyExc_RuntimeError,
26265 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26268 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
26269 #if PY_MAJOR_VERSION < 3
26270 if (likely(
v) && !PyLong_Check(
v)) {
26272 v = PyNumber_Long(tmp);
26277 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
26278 unsigned char *bytes = (
unsigned char *)&val;
26279 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
26280 bytes,
sizeof(val),
26281 is_little, !is_unsigned);
26287 return (Py_intptr_t) -1;
26291 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26292 if (!tmp)
return (Py_intptr_t) -1;
26293 val = __Pyx_PyInt_As_Py_intptr_t(tmp);
26298 PyErr_SetString(PyExc_OverflowError,
26299 "value too large to convert to Py_intptr_t");
26300 return (Py_intptr_t) -1;
26301 raise_neg_overflow:
26302 PyErr_SetString(PyExc_OverflowError,
26303 "can't convert negative value to Py_intptr_t");
26304 return (Py_intptr_t) -1;
26308 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
26309 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26310 #pragma GCC diagnostic push
26311 #pragma GCC diagnostic ignored "-Wconversion"
26313 const long neg_one = (long) -1, const_zero = (
long) 0;
26314 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26315 #pragma GCC diagnostic pop
26317 const int is_unsigned = neg_one > const_zero;
26319 if (
sizeof(
long) <
sizeof(long)) {
26320 return PyInt_FromLong((
long) value);
26321 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
26322 return PyLong_FromUnsignedLong((
unsigned long) value);
26323 #ifdef HAVE_LONG_LONG
26324 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
26325 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26329 if (
sizeof(
long) <=
sizeof(
long)) {
26330 return PyInt_FromLong((
long) value);
26331 #ifdef HAVE_LONG_LONG
26332 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
26333 return PyLong_FromLongLong((PY_LONG_LONG) value);
26338 int one = 1;
int little = (int)*(
unsigned char *)&one;
26339 unsigned char *bytes = (
unsigned char *)&value;
26340 return _PyLong_FromByteArray(bytes,
sizeof(
long),
26341 little, !is_unsigned);
26346 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
26347 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26348 #pragma GCC diagnostic push
26349 #pragma GCC diagnostic ignored "-Wconversion"
26351 const long neg_one = (long) -1, const_zero = (
long) 0;
26352 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26353 #pragma GCC diagnostic pop
26355 const int is_unsigned = neg_one > const_zero;
26356 #if PY_MAJOR_VERSION < 3
26357 if (likely(PyInt_Check(x))) {
26358 if (
sizeof(
long) <
sizeof(long)) {
26359 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
26361 long val = PyInt_AS_LONG(x);
26362 if (is_unsigned && unlikely(val < 0)) {
26363 goto raise_neg_overflow;
26369 if (likely(PyLong_Check(x))) {
26371 #if CYTHON_USE_PYLONG_INTERNALS
26372 const digit* digits = ((PyLongObject*)x)->ob_digit;
26373 switch (Py_SIZE(x)) {
26374 case 0:
return (
long) 0;
26375 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
26377 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
26378 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26379 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26380 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
26381 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
26386 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
26387 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26388 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26389 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
26390 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26395 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
26396 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26397 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26398 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
26399 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
26405 #if CYTHON_COMPILING_IN_CPYTHON
26406 if (unlikely(Py_SIZE(x) < 0)) {
26407 goto raise_neg_overflow;
26411 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26412 if (unlikely(result < 0))
26414 if (unlikely(result == 1))
26415 goto raise_neg_overflow;
26418 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
26419 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
26420 #ifdef HAVE_LONG_LONG
26421 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
26422 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26426 #if CYTHON_USE_PYLONG_INTERNALS
26427 const digit* digits = ((PyLongObject*)x)->ob_digit;
26428 switch (Py_SIZE(x)) {
26429 case 0:
return (
long) 0;
26430 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
26431 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
26433 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
26434 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26435 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26436 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26437 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26442 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
26443 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26444 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26445 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26446 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26451 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26452 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26453 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26454 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26455 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26460 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
26461 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26462 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26463 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26464 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26469 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26470 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26471 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26472 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26473 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26478 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
26479 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26480 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26481 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26482 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26488 if (
sizeof(
long) <=
sizeof(long)) {
26489 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
26490 #ifdef HAVE_LONG_LONG
26491 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
26492 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
26497 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26498 PyErr_SetString(PyExc_RuntimeError,
26499 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26502 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
26503 #if PY_MAJOR_VERSION < 3
26504 if (likely(
v) && !PyLong_Check(
v)) {
26506 v = PyNumber_Long(tmp);
26511 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
26512 unsigned char *bytes = (
unsigned char *)&val;
26513 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
26514 bytes,
sizeof(val),
26515 is_little, !is_unsigned);
26525 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26526 if (!tmp)
return (
long) -1;
26527 val = __Pyx_PyInt_As_long(tmp);
26532 PyErr_SetString(PyExc_OverflowError,
26533 "value too large to convert to long");
26535 raise_neg_overflow:
26536 PyErr_SetString(PyExc_OverflowError,
26537 "can't convert negative value to long");
26542 #if CYTHON_COMPILING_IN_CPYTHON
26543 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26549 return b == &PyBaseObject_Type;
26551 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26553 if (a == b)
return 1;
26557 n = PyTuple_GET_SIZE(mro);
26558 for (i = 0; i <
n; i++) {
26559 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26564 return __Pyx_InBases(a, b);
26566 #if PY_MAJOR_VERSION == 2
26567 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26568 PyObject *exception, *value, *tb;
26570 __Pyx_PyThreadState_declare
26571 __Pyx_PyThreadState_assign
26572 __Pyx_ErrFetch(&exception, &value, &tb);
26573 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26574 if (unlikely(res == -1)) {
26575 PyErr_WriteUnraisable(err);
26579 res = PyObject_IsSubclass(err, exc_type2);
26580 if (unlikely(res == -1)) {
26581 PyErr_WriteUnraisable(err);
26585 __Pyx_ErrRestore(exception, value, tb);
26589 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26590 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26592 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26597 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26599 assert(PyExceptionClass_Check(exc_type));
26600 n = PyTuple_GET_SIZE(tuple);
26601 #if PY_MAJOR_VERSION >= 3
26602 for (i=0; i<
n; i++) {
26603 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
26606 for (i=0; i<
n; i++) {
26607 PyObject *t = PyTuple_GET_ITEM(tuple, i);
26608 #if PY_MAJOR_VERSION < 3
26609 if (likely(exc_type == t))
return 1;
26611 if (likely(PyExceptionClass_Check(t))) {
26612 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
26618 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26619 if (likely(err == exc_type))
return 1;
26620 if (likely(PyExceptionClass_Check(err))) {
26621 if (likely(PyExceptionClass_Check(exc_type))) {
26622 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26623 }
else if (likely(PyTuple_Check(exc_type))) {
26624 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26628 return PyErr_GivenExceptionMatches(err, exc_type);
26630 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26631 assert(PyExceptionClass_Check(exc_type1));
26632 assert(PyExceptionClass_Check(exc_type2));
26633 if (likely(err == exc_type1 || err == exc_type2))
return 1;
26634 if (likely(PyExceptionClass_Check(err))) {
26635 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26637 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26642 static int __Pyx_check_binary_version(
void) {
26643 char ctversion[4], rtversion[4];
26644 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
26645 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
26646 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
26648 PyOS_snprintf(message,
sizeof(message),
26649 "compiletime version %s of module '%.100s' "
26650 "does not match runtime version %s",
26651 ctversion, __Pyx_MODULE_NAME, rtversion);
26652 return PyErr_WarnEx(NULL, message, 1);
26658 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
26660 #if PY_MAJOR_VERSION < 3
26661 if (t->is_unicode) {
26662 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
26663 }
else if (t->intern) {
26664 *t->p = PyString_InternFromString(t->s);
26666 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
26669 if (t->is_unicode | t->is_str) {
26671 *t->p = PyUnicode_InternFromString(t->s);
26672 }
else if (t->encoding) {
26673 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
26675 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
26678 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
26683 if (PyObject_Hash(*t->p) == -1)
26690 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
26691 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
26693 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
26695 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
26697 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
26698 #if !CYTHON_PEP393_ENABLED
26699 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
26701 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
26702 if (!defenc)
return NULL;
26703 defenc_c = PyBytes_AS_STRING(defenc);
26704 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
26706 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
26708 for (
c = defenc_c;
c < end;
c++) {
26709 if ((
unsigned char) (*
c) >= 128) {
26710 PyUnicode_AsASCIIString(o);
26716 *length = PyBytes_GET_SIZE(defenc);
26720 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
26721 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
26722 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
26723 if (likely(PyUnicode_IS_ASCII(o))) {
26724 *length = PyUnicode_GET_LENGTH(o);
26725 return PyUnicode_AsUTF8(o);
26727 PyUnicode_AsASCIIString(o);
26731 return PyUnicode_AsUTF8AndSize(o, length);
26736 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
26737 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
26739 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
26740 __Pyx_sys_getdefaultencoding_not_ascii &&
26742 PyUnicode_Check(o)) {
26743 return __Pyx_PyUnicode_AsStringAndSize(o, length);
26746 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
26747 if (PyByteArray_Check(o)) {
26748 *length = PyByteArray_GET_SIZE(o);
26749 return PyByteArray_AS_STRING(o);
26754 int r = PyBytes_AsStringAndSize(o, &result, length);
26755 if (unlikely(
r < 0)) {
26762 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
26763 int is_true = x == Py_True;
26764 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
26765 else return PyObject_IsTrue(x);
26767 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
26769 if (unlikely(!x))
return -1;
26770 retval = __Pyx_PyObject_IsTrue(x);
26774 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
26775 #if PY_MAJOR_VERSION >= 3
26776 if (PyLong_Check(result)) {
26777 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
26778 "__int__ returned non-int (type %.200s). "
26779 "The ability to return an instance of a strict subclass of int "
26780 "is deprecated, and may be removed in a future version of Python.",
26781 Py_TYPE(result)->tp_name)) {
26788 PyErr_Format(PyExc_TypeError,
26789 "__%.4s__ returned non-%.4s (type %.200s)",
26790 type_name, type_name, Py_TYPE(result)->tp_name);
26794 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
26795 #if CYTHON_USE_TYPE_SLOTS
26796 PyNumberMethods *m;
26798 const char *name = NULL;
26799 PyObject *res = NULL;
26800 #if PY_MAJOR_VERSION < 3
26801 if (likely(PyInt_Check(x) || PyLong_Check(x)))
26803 if (likely(PyLong_Check(x)))
26805 return __Pyx_NewRef(x);
26806 #if CYTHON_USE_TYPE_SLOTS
26807 m = Py_TYPE(x)->tp_as_number;
26808 #if PY_MAJOR_VERSION < 3
26809 if (m && m->nb_int) {
26811 res = m->nb_int(x);
26813 else if (m && m->nb_long) {
26815 res = m->nb_long(x);
26818 if (likely(m && m->nb_int)) {
26820 res = m->nb_int(x);
26824 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
26825 res = PyNumber_Int(x);
26829 #if PY_MAJOR_VERSION < 3
26830 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
26832 if (unlikely(!PyLong_CheckExact(res))) {
26834 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
26837 else if (!PyErr_Occurred()) {
26838 PyErr_SetString(PyExc_TypeError,
26839 "an integer is required");
26843 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
26846 #if PY_MAJOR_VERSION < 3
26847 if (likely(PyInt_CheckExact(b))) {
26848 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
26849 return PyInt_AS_LONG(b);
26851 return PyInt_AsSsize_t(b);
26854 if (likely(PyLong_CheckExact(b))) {
26855 #if CYTHON_USE_PYLONG_INTERNALS
26856 const digit* digits = ((PyLongObject*)b)->ob_digit;
26857 const Py_ssize_t size = Py_SIZE(b);
26858 if (likely(__Pyx_sst_abs(size) <= 1)) {
26859 ival = likely(size) ? digits[0] : 0;
26860 if (size == -1) ival = -ival;
26865 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
26866 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
26870 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
26871 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
26875 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
26876 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
26880 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
26881 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
26885 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
26886 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
26890 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
26891 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
26897 return PyLong_AsSsize_t(b);
26899 x = PyNumber_Index(b);
26901 ival = PyInt_AsSsize_t(x);
26905 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
26906 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
26908 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
26909 return PyInt_FromSize_t(ival);